0

I have a massive, unfamiliar Java codebase that I need to use in one of my projects, and unfortunately it's one of those situations where almost nothing is documented, and the very few things that are documented are of the "setFoo(Foo foo) - sets the foo." variety. So the documentation generated with javadoc is not as helpful as it could be.

I'm more of a Lisp and Python guy myself, so my first thought was that I could learn a lot by interactively playing with some of the relevant classes. Enter the Jython REPL. The problem is that I can't figure out how to set the...the whatever (classpath?) to use them. Assume that I have two directories containing the subdirectories containing the .java files: ~/project/foo/src/ and ~/project/bar/src/.

Thanks in advance.

1 Answer 1

1

It sounds like you first need to compile those Java classes (you've referenced src directories in your question).

Once you have classes compiled, you can reference them via the classpath.

e.g.

>>> import sys
>>> sys.path.append(r'C:\temp\sample.jar') 
>>> from org.my.package import MyClass

More info in this document

Sign up to request clarification or add additional context in comments.

1 Comment

You know, I'd seen this page and thought, "Oh, well that doesn't apply since I have .java files, not JARs." ...I also have JARs, I just--I don't even know what I was thinking :P Thanks a lot, though: that solved it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.