简体   繁体   English

双击无法在Windows中运行jar文件

[英]Unable to run jar file in Windows by double clicking

I am trying to run a very simple program by double clicking my Jar file with javaw. 我试图通过用javaw双击我的Jar文件来运行一个非常简单的程序。

It runs fine from Netbeans AND from the command line. 它从Netbeans和命令行运行良好。

My registry path to javaw: 我的javaw注册表路径:

"C:\\Program Files\\Java\\jre1.8.0_102\\bin\\javaw.exe" -jar "%1" %* “C:\\ Program Files \\ Java \\ jre1.8.0_102 \\ bin \\ javaw.exe”-jar“%1”%*

What is going wrong here? 这里出了什么问题? How can I make this work when I double click the Jar? 当我双击Jar时,如何才能完成这项工作?

Make sure your JAR file is an executable JAR; 确保您的JAR文件是可执行的JAR; I'm not entirely sure how to export an executable JAR from NetBeans (I use Eclipse), but this article seems to explain it pretty well. 我不完全知道如何导出从NetBeans中(我使用Eclipse)一个可执行的JAR,但是这个文章似乎可以解释它相当不错。

Make sure javaw.exe is the default program for running JARs. 确保javaw.exe是运行JAR的默认程序。 This question addresses that. 这个问题解决了这一点

There's also a Java Tutorial on making and using JARs, and several other StackOverflow questions about it. 还有一个关于制作和使用JAR的Java教程 ,以及其他一些关于它的StackOverflow问题。

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

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