Re: Classpath and jar
From: FISH (joeking_at_merseymail.com)
Date: 2 Jun 2004 04:42:28 -0700
Roedy Green <firstname.lastname@example.org> wrote in message news:<email@example.com>...
> Two related questions:
> Is this correct?
> java.exe -jar x.jar
> Then the classpath is irrelevant. Java is not allowed to peek on the
> classpath for missing classes outside the jar.
To the best of my knowledge -jar does not nullify -classpath/-cp, nor
any other command line switch.
(You can specify the classpath with a Class-Path line in the manifest
of your Jar, and these other jars/directories will be loaded as
extensions. You can also seal a package into a given Jar file in 1.2
if you want, which IIRC forbids classes from that package from being
outside of that file.)
> width="565" height="46"
> alt="Java needed to display this Applet.">
> <param name="flavour" value="strawberry">
> Java needed to display this Applet.
> If there is an archive jar, then the classpath and codebase is
> irrelevant. Java is not allowed to peek out side the jar.
Again, the existance of a Jar file does not nullify the plugin's
classpath or the HTML's stated codebase. Your applet does not
all have to be inside one archive.
(Are you sure your code attribute should end with ".class"? AFAIK
this is incorrect (although most browsers will correct it for you!) )