I have installed Jython, a virtualenv named "jython-env" and have installed "bottle" for doing some web application development. I have to use some JAR files in this application for consumption by some Python code. I know I have to set the classpath which should include these JAR files. I tried setting the classpath using
export classpath=/home/myname/jclasses/foo.jar
but when I try to import the class, it says module not found. I am very new at Java and am doing this for the first time.
Can't the configuration be done such that I can just put the JAR files in the sitepackages directory of my virtualenv and use it from there?
jython -Dpython.path=/path/to/myjar.jar
Here's another idea: you could use a .pth
file.
Create a file - /path/to/jythonenv/Lib/site-packages/myjars.pth
:
path/to/jar1.jar
path/to/jar2.jar
Would also do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With