Home > Enterprise >  I cannot double click .jar files but I can run them through cmd
I cannot double click .jar files but I can run them through cmd

Time:12-08

As far as I have figured out, I have to do something like this:

Open the Registry Editor, and navigate to HKEY_CLASSES_ROOT\jarfile\shell\open\command, and modify the value of the Default key as follows Replace [Location of your JRE] in "[Location of your JRE]\bin\javaw.exe" -jar "%1" %* with the root directory of your JRE installation. For example, "C:\Program Files\Java\jre7\bin\javaw.exe" -jar "%1" %*. Repeat the above steps for HKEY_LOCAL_MACHINE\SOFTWARE\Classes\jarfile\shell\open\command.

The problem is that I don't have that "jarfile".

I would appreciate any help.

CodePudding user response:

The registry portion is basically notifying the OS that when you attempt to run the jar file what program to use, where it located and the arguements to specify opening a jar file with that application.

It you dont have javaw.exe then install java, if your talking about the "%1" %* then its just a way of saying run javaw.exe -jar "file.jar" where file.jar is the jar file you double clicked on. "%1" %* does not and will not exist as a file or object.

  •  Tags:  
  • java
  • Related