简体   繁体   English

如何在创建 jar 文件时包含库文件

[英]How to include library files while creating jar files

How to include JOGL.jar and Gluegen-rt.jar in the java project?如何在 java 项目中包含 JOGL.jar 和 Gluegen-rt.jar? I have included these external jars in the eclipse, but when I try to create a Jar file of the project, the JAR file does not exceute. I have included these external jars in the eclipse, but when I try to create a Jar file of the project, the JAR file does not exceute. It says That JOGL.jar is missing.它说缺少 JOGL.jar。

How can I include these libraries?如何包含这些库? Any suggestions are welcome.欢迎任何建议。

How can I include these libraries?如何包含这些库? Any suggestions are welcome.欢迎任何建议。

Either you distribute multiple jar-files, and make sure the referenced jar-files are mentioned in the classpath in the manifest of your application.您可以分发多个 jar 文件,并确保在应用程序清单的类路径中提到了引用的 jar 文件。

However, since you say "include" I suspect you want to "merge" the jar files into a single jar file.但是,由于您说“包含”,我怀疑您想将 jar 文件“合并”到单个 jar 文件中。 In that case you need to merge the jars using software such as OneJar or FatJar .在这种情况下,您需要使用OneJarFatJar等软件合并 jars。

Check whether the jar is there in the classpath.检查类路径中是否存在 jar。

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

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