Its kinda weird but recently I was having some problems running java files. I noticed that my .jar files is not associated anymore so I tried to install java (version 7 update 25). However, it did not associate the .jar files on my machine so I went over the internet to find some answers. Most of the topics that I have found suggest that I should change my default file associations and run the .jar file on the Command Prompt. For me, its a good suggestion since it will work for me (I’m a Command Prompt kind of person). However, what if the user does not want to fire up the Command Prompt every time he or she wants to run a .jar file?
Motivated by that problem, I tried to find alternatives on how to fix this. I did not search the internet this time but I am positive that this alternative also exists in the World Wide Web. To start off:
- You have to find the executable file in .jar extension (filetype: java, jar).
- Next, open up Control Panel > Add / Remove Programs and search for a Java Installation.
- If you have no Java installation entries found in the Control Panel, head over here to install Java. If you have two entries of Java installations, you’ll have to remove the the other one. But which one? Well, I don’t have a concrete answer but I think it will be safer if you remove the older version. (In my case I have Java version 6 and Java version 7. I removed version 7 and my .jar file ran!)
- Now at this stage you should only have one java installation.
- Go to the executable file, right click it, select open with then click Choose Default Program. Tick, Always use the selected program to open this kind of file then click Browse and head to C:\Program Files\Java\jre6\bin\ and select javaw.
- Click ok and every .jar file in your computer will be associated with Java. Now all you have to do is double click the file and it will run in java. No need to redo the steps that I have mentioned.
Hope this will be helpful!