Re: Java Installation Doubts...
Roedy Green wrote:
java.exe -jar x:\dir\xxx.jar
The jar can be anywhere.
Library jars are most easily handled by putting them in the ext dir.
ext directories are good for things that you want as part of your Java
platform generally. Things like log4j and commons-collections are good
candidates for this sort of primacy. For more occasional classpath variation,
or to give programs the choice of particular libraries, there are tricks to
localize the classpath to the application itself.
The trick for JAR files run via the 'java -jar' command, the classpath in your
local environment is ignored at levels below the ext directory level. The JAR
is sort-of self-contained with respect to classpath, ignoring both the
CLASSPATH environment variable and the -cp (-classpath) option to the 'java'
command. Inside its own manifest, it will often specify its own classpath,
and that will comprise JARS that it specifically needs. Usually those JARs go
in the same directory as the application JAR itself.
Inside the 'foo.jar' manifest would be