M
Martin Gregorie
I have a problem with class path behavior when trying to run an app from
within a jar file. The app depends on other jar files, e.g. JDBC driver,
JavaMail, that are not part of the standard distribution.
The manifest sets Start-Class. If I also add Class-Path: to the manifest
with a copy of $CLASSPATH as its argument (':' replaced with space)
Start-Class set the application runs with the command:
"java -jar jarfile.jar arguments...."
but if I remove the Class-Path from the manifest I can't get the
application to run from the jar file regardless of whether I let the
class path default to $CLASSPATH or supply it explicitly to the java via
the -classpath option. I'd prefer not to specify the class path in the
manifest because I can't guarantee that the required support jar files
will be in the same place on other systems.
The jar file is in the same directory as the collection of *.class
files. Running "jar StartClass arguments..." works just fine, so there's
nothing wrong with $CLASSPATH. The class files form an application suite
rather than a library and so are not part of a package.
As I understand the definition of the manifest and class path behavior,
if there is no "Class-Path:" parameter in the manifest the class path
should default to the class path given by -classpath or, if that's
absent, to $CLASSPATH. What have I misunderstood?
TIA,
Martin
within a jar file. The app depends on other jar files, e.g. JDBC driver,
JavaMail, that are not part of the standard distribution.
The manifest sets Start-Class. If I also add Class-Path: to the manifest
with a copy of $CLASSPATH as its argument (':' replaced with space)
Start-Class set the application runs with the command:
"java -jar jarfile.jar arguments...."
but if I remove the Class-Path from the manifest I can't get the
application to run from the jar file regardless of whether I let the
class path default to $CLASSPATH or supply it explicitly to the java via
the -classpath option. I'd prefer not to specify the class path in the
manifest because I can't guarantee that the required support jar files
will be in the same place on other systems.
The jar file is in the same directory as the collection of *.class
files. Running "jar StartClass arguments..." works just fine, so there's
nothing wrong with $CLASSPATH. The class files form an application suite
rather than a library and so are not part of a package.
As I understand the definition of the manifest and class path behavior,
if there is no "Class-Path:" parameter in the manifest the class path
should default to the class path given by -classpath or, if that's
absent, to $CLASSPATH. What have I misunderstood?
TIA,
Martin