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

南楼画角 提交于 2019-12-08 04:44:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!