I am aware that the following all sometimes impact your classpath, but I would like to know more precisely, when and how do the following impact it?
Class-Path in your manifestCLASSPATH in your enviornment-cp/-classpath on the command line-jar on the command lineExample:
I know that if -jar is specified that the jar you specify will be on the classpath and that -cp/-classpath, and CLASSPATH will all be ignored.
I believe that if -cp/-classpath is specified, CLASSPATH will be ignored.
Class-Path is a near total mystery to me right now. I know that if you specify a jar with -jar, it will use the Class-Path from that jar's manifest. Will it also use the Class-Path of a jar for classes within that jar, even if it wasn't specified by -jar? Will it be used for all classes, not just classes within the jar? Do they add together or replace each other? What prescience does Class-Path take within your classpath? Will it be the last thing checked, the first thing checked, or somewhere in between?
Also, for all the different ways you can specify things to be on your classpath, what is the proper syntax? Are commands valid/required? Can I have multiple Class-Paths specified in a manifest (IE, can I put one per line to make it easier to read?)
From the following site http://www.ntu.edu.sg/home/ehchua/programming/howto/Environment_Variables.html under how classes are found
User classes search path (in short, class path): determined in the following order:
CLASSPATH environment variable, which overrides the default.-cp (or -classpath) command-line option, which overrides the CLASSPATH environment variable.-jar, which override all the above.The user class paths are kept in Java System property java.class.path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With