Win7 jar file cannot be opened solution

The first method:
      Step 1: Create a new text document, enter the content "javaw -jar %1", and save it as a batch file, such as "run.bat".
      Step 2: Right-click the file in .jar format and select the open method as run.bat built above.
      At this point the jar can be run....

 

 

The second method:
      The first method can solve the problem, but there are some shortcomings, here is a better method: solve the problem by modifying the registry.
      Step 1: Open the registry, start -> run (or use the shortcut key WIN+R), enter regedit, and confirm

      Step 2: Select the default program: Right-click the .jar file, open with -> select default program -> browse, and select javaw.exe in the bin file under jre.

 Edit the registry: HKEY_CLASSES_ROOT\Applications\javaw.exe\shell\open\command, modify the data value to ["D: \Program Files\Java\jdk1.6.0_21

\jre\bin\javaw.exe" -jar "%1" ] (In square brackets, just add –jar before the original value of "%1").

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326196904&siteId=291194637