Java Jar 文件不会在双击时运行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21491550/
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
Jar file won't run on double click
提问by gedr
I know you may blame me for this being a dupe - but frankly, I do not know what to do next. I spent hours online trying to find my solution, and have found nothing. Zilch. Zero.
我知道你可能会因为这是个骗子而责怪我 - 但坦率地说,我不知道下一步该怎么做。我在网上花了几个小时试图找到我的解决方案,但一无所获。齐尔奇。零。
Anyway, this is my problem: when I double click my runnable jar file, it shows a hourglass cursor for a second and then it disapears, leaving me with nothing. I have re installed my JDK and JRE 2 times, and nothing happens. Here is my manifest file:
无论如何,这是我的问题:当我双击我的可运行 jar 文件时,它会显示一个沙漏光标一秒钟,然后它消失了,让我一无所有。我已经重新安装了 JDK 和 JRE 2 次,但没有任何反应。这是我的清单文件:
Manifest-Version: 1.0
Class-Path: .
Main-Class: gedr.proj.Paint.Frame
I have tried to run my application via the command line, but am baffled by how to do it.
我曾尝试通过命令行运行我的应用程序,但对如何执行感到困惑。
Tell me if you need any more information, or tell me what to do. Thanks in advance
如果您需要更多信息,请告诉我,或者告诉我该怎么做。提前致谢
EDIT: If I try 'java -jar PaintV2.jar' in cmd, it returns
编辑:如果我在cmd中尝试'java -jar PaintV2.jar',它会返回
Error: Unable to access jarfile PaintV2.jar
when I run 'ftype | find "jarfile"' it returns
当我运行 'ftype | 找到“jarfile”'它返回
jarfile="C:\Program Files\Java\jre7\bin\javaw.exe" -jar "%1" %*
采纳答案by Roberto Ani? Bani?
Navigate to your file in cmd, and then type
在 cmd 中导航到您的文件,然后键入
java -jar jarfile.jar
If you can could you upload the file please?
如果可以的话,可以上传文件吗?
回答by Stephen Corcoran
In the command line type java -jar jar_name.jar.
在命令行中输入 java -jar jar_name.jar。
If there are any errors it will show you.
如果有任何错误,它会显示给你。