Why does my JAR file execute at CMD, but not on double-click?

Ok, so I was stuck on this exact issue for over a week now (it has been for a side project for which I could only devote a few hours a day).

This happened on my desktop, but for some reason wouldn’t happen on the laptop.

After looking around, I found this answer and I thought I’d share it for people who are like me, found nothing useful in the accepted answer here. Credits go to anonymous Stack Overflow user, whom username I’ve lost in all the excitement.

As mentioned by some other answer somewhere to an seeming unrelated issue, use this little program to associate your JAR files to the 64 bit version of java:

http://johann.loefflmann.net/en/software/jarfix/index.html

Save the program somewhere and run it from command line with the parameter /64:
c://path//jarfix.exe /64

Nothing else worked for me, but this was like magic. 🙂

Leave a Comment