0

Sorry if this a little dumb, but I have a .jar file that runs great when i type java -jar quiz.jar. But it doesn't work when i just double click on the file. I have it set to open with java.exe, and all my other .jars work fine. it's just the ones i've created. Any Ideas? Thanks.

Stefan Carlson
  • 372
  • 3
  • 7
  • 21

2 Answers2

1

What you can do is adding an option in your context menu (using registry). For example, you can copy this code into a .reg file and run it. You should have a "Run Jar" option in your context menu. I did it on my Windows installation and it works great.

[HKEY_CLASSES_ROOT\*\shell\Run Jar]

[HKEY_CLASSES_ROOT\*\shell\Run Jar\command]
@="java.exe -jar %1"

If want to remove this option, create and execute a new .reg file which contains :

[-HKEY_CLASSES_ROOT\*\shell\Run Jar]
Junior Dussouillez
  • 2,327
  • 3
  • 30
  • 39
0

Simply by doing:

  1. right-click on the JAR,
  2. "Open With...",
  3. and then select the javaw.exe from your JRE's bin folder,
  4. tick the "always use the selected program to open this kind of file".

Note that it has to be javaw.exe, not java.exe. Do browse to the correct location yourself to make sure.

This alternative should work as well.

Community
  • 1
  • 1
haylem
  • 22,460
  • 3
  • 67
  • 96