简体   繁体   English

jar清单classpath和-classpath命令行选项如何组合

[英]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 如果我有一个可执行jar X.jar,在清单中定义了一个类路径,并且我想在类路径中包含其他jar,那么

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. COMBINE这些类路径或OVERRIDE X.jar中的清单类路径与命令行中指定的类路径。

(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. 如果指定'java -jar',则忽略-classpath选项,并且有效的CLASSPATH来自清单。

If you don't specify 'java -jar',the manifest Class-path is ignored. 如果未指定“java -jar”,则忽略清单类路径。

This is all documented. 这都记录在案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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