Java 类路径和清单文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21169814/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 07:05:37  来源:igfitidea点击:

CLASSPATH and Manifest file

javajarclasspathmanifest

提问by user3192053

I do not understand the rules of setting a classpath within a manifest of a jar file.

我不明白在 jar 文件的清单中设置类路径的规则。

I seem to get it to work and then not get it to work. From the documentation I have read so far I only know you can't use wildcards

我似乎让它工作,然后没有让它工作。从我目前阅读的文档中我只知道你不能使用通配符

Could someone please post a link on how to set the classpath within a jar file

有人可以发布一个关于如何在 jar 文件中设置类路径的链接

采纳答案by Jakub Kubrynski

Normally you generate manifest files by using build tools like Maven or Gradle.

通常,您使用 Maven 或 Gradle 等构建工具生成清单文件。

If you want to do it manually you have to use following form:

如果您想手动执行此操作,则必须使用以下表格:

Class-Path: jar1-name jar2-name directory-name/jar3-name

If you want to read more about it please visit http://docs.oracle.com/javase/tutorial/deployment/jar/downman.html

如果您想阅读更多相关信息,请访问http://docs.oracle.com/javase/tutorial/deployment/jar/downman.html

回答by Neeraj Krishna

This method is used while a jar you are using is in turn dependent on other jars. Here is the link : http://docs.oracle.com/javase/tutorial/deployment/jar/downman.html... One of the places I have seen it being used is WebSphere MQ http://pic.dhe.ibm.com/infocenter/wmqv7/v7r1/topic/com.ibm.mq.doc/jm10330_.htm

当您使用的 jar 又依赖于其他 jar 时,将使用此方法。这里是链接:http://docs.oracle.com/javase/tutorial/deployment/jar/downman.html......一个我已经看到了正在使用的地方是WebSphere MQ的HTTP://pic.dhe。 ibm.com/infocenter/wmqv7/v7r1/topic/com.ibm.mq.doc/jm10330_.htm