If you are using Windows environment, you should include the jar in your CLASSPATH prior to invoking the script. 
For instance, perform a set CLASSPATH=<path to your jar>/yourjar.jar and then invoke your script.
That should do the trick.
----- Original Message -----
From: Alec Lebedev
To: jython-users@lists.sourceforge.net
Sent: Thursday, October 19, 2006 5:11 PM
Subject: [Jython-users] adding JARs to sys.path


I have a jython script, which calls a Java class, which requires a certain jar to be on the classpath. I want to add the necessary jar to the classpath in jython before calling the java class. I tried the following:

However, the java class still throws NoClassDefFoundError. I also tried the following with no success:
import jreload
jreload.makeLoadSet( "myset", ["C:/dev/lib/myjar.jar"] )

How can I add a jar to java classpath before calling the java class?



Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo

Jython-users mailing list