“Could not find the main class” when double-clicking .jar file

前端 未结 6 1789
逝去的感伤
逝去的感伤 2020-12-02 16:58

First: I realize that this issue should be quite simple and lots of people seem to have experienced it. However, it appears my issue may be slightly different from

6条回答
  •  时光取名叫无心
    2020-12-02 17:56

    Just found this post...

    If you have the problem only when double clicking the jar file and not at cmd launch, it's probably because the version of the JRE is wrong (6 in place of 7).

    Just change the value in regedit at :

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\jarfile\shell\open\command] "C:\Program Files (x86)\Java\jre6\bin\javaw.exe" -jar "%1" %*

    to :

    "C:\Program Files\Java\jre7\bin\javaw.exe" -jar "%1" %*

    There should be no problem if this value is updated.


    Note : Switching between 32 and 64 bits versions on Windows :

    -> "C:\Program Files\Java\jre7\bin\javaw.exe" -jar "%1" %* will use the 64 bits version of the JRE -> "C:\Program Files (x86)\Java\jre7\bin\javaw.exe" -jar "%1" %* will use the 32 bits version of the JRE

提交回复
热议问题