Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Overnight, Java seems to have been corrupted on my computer. I had Java JDK and regular Java installed. The first thing that was happening when I tried to execute a .jar file was a message asking how to open the .jar file. I thought to myself: "That's quite unusual, I should just try reinstalling". Uninstalled both Java and JDK. Reinstalled Java. Click on the .jar file: still can't open the file regularly. I realized it has been popping a cmd window up. I got a message that said it couldn't find the class. Ok, I was starting to get worried. Unninstalled Java again. Went to C:\Program Files and C:\Program Files(x86) and deleted the content inside the Java folder that was on both paths. I remembered I had a custom System Variable called Path because Java had already gone weird on me before. Deleted the Path variable. Restart computer. Reinstall Java. Same errors. Unninstall Java. Install Java 32-bit to see if it makes a difference. It doesn't. Tried to Unninstall Java 32-bit. Can't, the unninstaller wizard pops up, closes and nothing happens, the Java program is still on my Programs list. I get very frustrated thinking that clean install just won't work. Bit of panic. I come crying to superuser to ask the pros what to do. Help?

EDIT: Waiting for answers, I'll keep trying to install and uninnstall stuff back in forth, maybe it works. Tried deleting things on regedit as I was told by someone in another forum. Just editing this so people can keep track of the stupid or helpful things I'm doing. Continuing.

EDIT2: Installed Java 64-bit again. Tried to run the file under the command "java -jar". It worked under the command. Double-clicking still doesn't work. I think God hates me. I think I should stop making jokes on a forum. Sorry. Going on.

share|improve this question
    
Check your system environment variables, look for "Path". Something like "C:\Program Files\Java\jre7\bin" should in the list of values for "Path" Also, check to see what the jar file is trying to launch with, you need to make sure it is launching with the proper Java executable. –  Brutick Nov 22 '12 at 18:57
    
This is my path: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%JAVA_HOME\bin;%AN‌​T_HOME%\bin The jar file worked before so I think it should work by default. Other suggestion? –  Robert Johnson Nov 22 '12 at 21:56

1 Answer 1

I'm assuming that right now inability to run jar files is the only problem.

You'll have to mess with the registry to fix this. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Classes\jarfile\shell\open\command and check the value there.

For example, mine reads "C:\Program Files\Java\jre7\bin\javaw.exe" -jar "%1" %*

Ensure that the path to javaw.exe is valid and correct if necessary. Should work after that.

share|improve this answer
    
Mine was exactly like yours, so still no result. Any other suggestions? –  Robert Johnson Nov 22 '12 at 21:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.