问题
If I have an executable jar X.jar, with a classpath defined in a manifest, and I want to include other jars on the classpath than these, will
java -classpath a.jar;b.jar;c.jar -jar X.jar
COMBINE these classpaths or OVERRIDE the manifest classpath in X.jar with the classpath specified on the command line.
(and if they will be combined, in what order will they be combined)?
回答1:
They don't combine.
If you specify 'java -jar', the -classpath option is ignored, and the effective CLASSPATH comes from the manifest.
If you don't specify 'java -jar',the manifest Class-path is ignored.
This is all documented.
来源:https://stackoverflow.com/questions/25004206/how-do-jar-manifest-classpath-and-classpath-command-line-option-combine