Message706

Author tlau
Recipients
Date 2002-08-22.17:40:52
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
When running a jar containing a standalone executable
using "java -jar", Java ignores any user-supplied
CLASSPATH and assumes that all user classes are
contained within the jar.  This behavior causes a
problem when a Jython program references classes
contained in a 3rd party jar file.  The program cannot
be run using "java -jar myprogram.jar" when it
references 3rd-party classes.  The temporary workaround
is to run the program using
"CLASSPATH=3rdparty.jar:myprogram.jar java myclass",
but this is ugly.

The proper way to address this problem is to have the
Jythonc compiler add an entry to the jar's MANIFEST.MF
file with lines like "Class-Path: 3rdparty.jar", which
will cause Java to look in the named jar files for
additional user classes.

I'm enclosing a patch against Jython 2.1 which adds an
"--externaljars" flag to jythonc that enables the user
to list the 3rd party jars on the jythonc command line
and adds the relevant entries to the manifest.
History
Date User Action Args
2008-02-20 17:17:08adminlinkissue598901 messages
2008-02-20 17:17:08admincreate