First, I am studying Java, but I am still very new to it, so complicated code will go over my head.
When I download a .jar file to say install a mod to minecraft and double click it, it doesn't run. The loading wheel goes for like two seconds and then stops, and nothing else happens. The .jar I know is set up right because it runs through cmd with the command
cd "wherever the file is"
java -jar "file name".jar
I had the same problem, and it turns out that the .jar file association in the registry was broken. The following steps fixed it:
Open the Registry Editor, and navigate to HKEY_CLASSES_ROOT\jarfile\shell\open\command. Modify the value of the Default key as follows:
"[Location of your JRE]\bin\javaw.exe" -jar "%1" %*
Replace [Location of your JRE] with the root directory of your JRE installation.
"C:\Program Files\Java\jre7\bin\javaw.exe" -jar "%1" %*
Repeat the above steps for HKEY_LOCAL_MACHINE\SOFTWARE\Classes\jarfile\shell\open\command.
I have a Windows 7 machine, but I assume this would work for 32-bit environments as well.
EDIT: Fixed the path in the example - it should use the "Program Files" directory and not "Program Files (x86)".