使用文件夹中的 jar 执行 jar 文件
我位于 Windows 环境中的 E:/foo/bar 文件夹内。我有一个 jar 文件,名为 E:/foo/bar/a.jar。 foo/bar 里面还有很多 jar 文件。另外,在 foo/bar 下还有另一个名为 ext 的目录。它还包括很多 jar 文件。
我想运行 a.jar 并将这些 jar 包含在类路径(当前目录和 ext 目录)中。所以我用了这个。
java -jar a.jar -classpath *:/ext/*
这不起作用。我没有在 a.jar 的 MANIFEST.MF 中添加任何条目,认为这将从 -classpath 条目中获取。我在这里做错了什么?
谢谢
I am inside a E:/foo/bar folder inside windows environment. I have a jar file as E:/foo/bar/a.jar. Also inside foo/bar there are lot of jar files. Also under the foo/bar there is another directory called ext. It also includes lot of jar files.
I want to run the a.jar with those jars included in the class path(both current directory and ext directory). So I used this.
java -jar a.jar -classpath *:/ext/*
This didn't work. I didnt add any entries in the MANIFEST.MF in a.jar thinking that this will be fetched from the -classpath entry. What am I doing wrong here?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果指定了
-jar
,则忽略-classpath
选项。我可以看到两种可能的行动方案:
-jar
选项。java -classpath *:/ext/* com.our.MainClass
The
-classpath
option is ignored if-jar
is specified.Two possible course of action I can see:
-jar
option of the invocation.java -classpath *:/ext/* com.our.MainClass