From: Robert W. B. <rb...@di...> - 2001-10-22 18:39:23
|
Hello Hubert, On Mon, 22 Oct 2001, yoshizak wrote: > Hi there, > I was looking at the error message and the problem with PyProxy lead me > to think I should put the jython.jar into the class path (I believe I > saw another e-mail in the user archives that said something about this) Yes, jython.jar is needed. Using jythonc without the --deep or --all options compiles your script to java bytecode, but running that script still requires the Jython classes found in jython.jar. There are times when using jythonc's --deep and --all options are beneficial because they allow you to include required jython files in a single jar. > don't exactly know why I needed to do this, since I had presumed that > this was done by default Java has no default or intuitive knowledge of Jython, so you must be explicit about these things when running commands that start with "java ". > but when I ran my code sample with > java -classpath <some directory tree>/jython-2.0/jython.jar:. tryJythonMain > it finally seemed to run. (Yeah! Finally! :) Excellent. > Question is, why did I need to do this? I mean, I'm sure not 'everyone' > actually specifies the jar file when running their programs. The classes in jython.jar are always needed. Yes, 'everyone' doesn't always specify the jython.jar file on the command line. Some have explicitly added it to their classpath by some other means or they have used jythonc's --deep or --all option. If you use --deep/--all, the files from jython.jar are included in the output jar; but in the end, the files in the jython.jar file are always needed. > Do I really > need to specify the jar file in the classpath (or CLASSPATH)? The required classes in jython.jar must get stuck in the classpath one way or another. Cheers, Robert |