简体   繁体   中英

How do jar manifest classpath and -classpath command line option combine

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)?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM