在类路径中包含 jar 文件 [英] Including jar files in class path
本文介绍了在类路径中包含 jar 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在从一个引用一些外部 jar 文件的批处理文件运行一个 java 程序.我如何将这些 jar 文件包含在我的批处理文件中.请帮助
I m running a java program from a batch file which refences some external jar files .How do i include those jar files in my batch file.Please help
推荐答案
看Sun的官方文档:设置类路径 以了解您的选项.
Look at the Sun's official documentation: Setting the class path to understand your options.
一种快速的方法是在 -cp
之后包含您的 JAR:
A quick way would be just to include your JAR(s) after the -cp
:
java -cp C:javaMyClassesmyclasses.jar;C:javaMyClassesmyclassesAnother.jar utility.myapp.Cool
在 Linux/Unix 上
java -cp /opt/thirdparty/myclasses.jar:/opt/thirdparty/myclassesAnother.jar utility.myapp.Cool
这篇关于在类路径中包含 jar 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文