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

Hi,

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:
sys.path.append("C:/dev/lib/myjar.jar");

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?

Thanks.

Alec


-------------------------------------------------------------------------
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
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users