From: John M. <joh...@ho...> - 2001-10-10 21:17:34
|
I've got an application that is run from Java Web Start (or any JNLP launcher). Because it is run from a JNLP file it has to come in the form of one or more jar files. Recently I added IBM's Bean Scripting Framework (BSF) and Jython as one of the languages so I now include bsf.jar and jython.jar with my application. So far, so good... But if I run a script that does something like: from pawt import swing I get an error because it doesn't know what pawt is, I assume I would get the same error using any of the various Python modules. This is hardly surprising though as I didn't include the library it needed. Unfortunately, my crude attempt to add the library by turning the Lib directory from jython-2.1a3 into a Lib.jar file did not work. It still doesn't find pawt even when I just run the BSF from the command line like so: C:\Program Files\jython-2.1a3\Demo\swing>java com.ibm.bsf.Main -in simple.py -mode exec Traceback (innermost last): File "<string>", line 7, in ? ImportError: no module named pawt exception from Jython: Traceback (innermost last): File "<string>", line 7, in ? ImportError: no module named pawt : Traceback (innermost last): File "<string>", line 7, in ? ImportError: no module named pawt The classpath in this case included bsf.jar, jython.jar, and the Lib.jar I made. It was capable of running another example from the BSF examples that only used the awt and didn't need pawt. Question 1: Is there a way to create a jar I can include with my distribution that I can include in my classpath and jython will find its library files within it? I did get a message from the jython runtime telling me it was "processing" (or something like that) Lib.jar the first time I ran this command with Lib.jar in the classpath but I still got the error seen above. Question 2: Shouldn't there be a way to do this AND shouldn't the jar be provided by default or a way to create it be provided? Distribution of jython with other applications is hardly an unusual thing. Thanks very much, John Munsch http://www.johnmunsch.com _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp |