Running a .jar file in a command line works fine, but i am not able to run any .jar file by double clicking on my Windows 7 (64). It seems nothing happens after the double click.
I tried the ftype
hint, no success:
ftype jarfile="C:\Program Files\Java\jre7\bin\javaw.exe" -jar "%1" %*
I reinstalled the JDK 7 64-bit, no success.
Any idea?
You need to run a Java Archive File (JAR) to execute a Java Runtime Environment (JRE) based application in a Windows 10, 11 or Windows Server environment. Double clicking the JAR file does not case any action or it does not work as expected and the Java application is not launched.
Options that control the jar command. jarfile. File name of the Jar file to be created ( c ), updated ( u ), extracted ( x ), or have its table of contents viewed ( t ). The -f option and filename jarfile are a pair -- if either is present, they must both appear.
If you have previously used the right click and opened with \path\to\your\javaw.exe then you will need to remove the following registry key.
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jar]
Then run
C:\>assoc .jar=jarfile
C:\>ftype jarfile="C:\path\to\your\javaw.exe" -jar "%1" %*
What is listed in right-click-> Open With ? Is some other program listed as the default program ? Is a Java Runtime listed ? If a Java Runtime is listed, you can open with it, and make it the default program to run with.
ie,
Right Click -> Properties -> Change -> C:\Program Files\Java\jre7\bin\javaw.exe
You may also run it from the Command Prompt (cmd):
java.exe -jar file.jar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With