I searched and found the link: How to open/run .jar file (double-click not working)? But it did not solve the problem, so I solved it by editing the registry.
Because of my reputation I could not post my answer to the above post so I asked it here to answer it myself.