jar manifest classpath和-classpath命令行选项如何组合 [英] How do jar manifest classpath and -classpath command line option combine

查看:144
本文介绍了jar manifest classpath和-classpath命令行选项如何组合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个可执行的jar X.jar,在清单中定义了一个类路径,并且我想在类路径上包含除这些以外的其他jar,则将

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

结合这些类路径 或者 用命令行上指定的类路径覆盖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)?

推荐答案

它们不结合.

如果指定'java -jar',则-classpath选项将被忽略,有效的CLASSPATH来自清单.

If you specify 'java -jar', the -classpath option is ignored, and the effective CLASSPATH comes from the manifest.

如果您未指定'java -jar',则清单类路径将被忽略.

If you don't specify 'java -jar',the manifest Class-path is ignored.

全部记录在案.

这篇关于jar manifest classpath和-classpath命令行选项如何组合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆