我有一个名为helloworld.jar的JAR文件。 为了运行它,我在命令行窗口中执行以下命令:
java -jar helloworld.jar
这工作得很好,但我如何执行它与双击? 我需要安装什么软件吗?
我有一个名为helloworld.jar的JAR文件。 为了运行它,我在命令行窗口中执行以下命令:
java -jar helloworld.jar
这工作得很好,但我如何执行它与双击? 我需要安装什么软件吗?
当前回答
我正在运行Windows 7 x64,无法使用任何这些修复程序。
这条对我来说还是有用的:
http://thepanz.netsons.org/post/windows7-jar-file-association-broken-with-nokia-ovi
你可以下载一个包含要运行的.bat文件的存档文件,但请检查实际的javaw.exe!!!!的路径
其他回答
最简单的方法可能是升级或重新安装Java运行时环境(JRE)。
或:
Open the Windows Explorer, from the Tools select 'Folder Options...' Click the File Types tab, scroll down and select JAR File type. Press the Advanced button. In the Edit File Type dialog box, select open in Actions box and click Edit... Press the Browse button and navigate to the location the Java interpreter javaw.exe. In the Application used to perform action field, needs to display something similar to C:\Program Files\Java\j2re1.4.2_04\bin\javaw.exe" -jar "%1" % (Note: the part starting with 'javaw' must be exactly like that; the other part of the path name can vary depending on which version of Java you're using) then press the OK buttons until all the dialogs are closed.
这是从这里偷来的:http://windowstipoftheday.blogspot.com/2005/10/setting-jar-file-association.html
创建.bat文件:
start javaw -jar %*
然后选择app default,用这个。bat文件打开。jar。
当启动.jar文件时,它将关闭cmd。
编译:
javac -cp ".;./mysql-connector-java-5.0.8.jar;mybatis-3.0.1.jar;ibatis-2.3.0.677.jar" MainStart.java
为运行:
java -cp ".;./mysql-connector-java-5.0.8.jar;mybatis-3.0.1.jar;ibatis-2.3.0.677.jar" MainStart
在windows上运行.jar文件有很多方法。其中一个正在使用命令提示符。
步骤:
打开命令提示符(以管理员身份运行) 现在为根目录写入“cd\”命令 输入“java jar文件名。jar” 注意:你也可以使用任何第三方应用程序,如WinRAR, jarfix等。
开始。球棒是唯一对我有用的东西。
打开一个文本文档并输入。Java -jar,不管你叫。jar
另存为start.bat,保存在与要执行的.jar文件相同的文件夹中。然后运行。蝙蝠