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

Perhaps your file associations got messed up. At the command prompt, try running

ftype | find "jarfile"

On my 64-bit Windows 7 computer, that shows

jarfile="C:\Program Files (x86)\Java\jre6\bin\javaw.exe" -jar "%1" %*

You can also change it with ftype:

ftype jarfile="C:\Program Files (x86)\Java\jre6\bin\javaw.exe" -jar "%1" %*

Leave a Comment