Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just recently installed JDK7 and then afterwards I uninstalled it because I couldn't run java from command line in Windows7. I tried to reinstall JDK7 after uninstalling it, but it doesn't help. When I input java in command line I get the following.

enter image description here

Anyone know how to fix this problem? I tried to google and none of the answer solved my problem.

share|improve this question

Looks like registry keys are some how altered.

Open registry editor (search in start menu) and go to the path HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.7, and see if following entries exist or not.

JavaHome C:\Program Files\Java\jre7

Microversion 0

RuntimeLib C:\Program Files\Java\jre7\bin\client\jvm.dll

Also, go to HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.7, and look for following key.

JavaHome C:\Program Files\Java\jdk1.7.0

Microversion 0

If above keys do not exist, instead of creating them manually, I would recommend you to remove currently installed JDK 7 and make a fresh installation of the same.

Once done, add following paths to their respective environment variables.

classpath C:\Program Files\Java\<jdk folder>\lib ;

path C:\Program Files\Java\<jdk folder>\bin

And than try running java and javac.

Hope this helps.

share|improve this answer
    
I have those entries in the registry, and I tried to reinstall JDK7 many times already. All times with the same results – starcorn Nov 24 '11 at 14:06
    
You may want to look at this – Kushal Nov 24 '11 at 14:39
    
Also, uninstall JDK and delete respective registry keys to and than make clean install, since most of the applications never delete their registry entries even if they are uninstalled. – Kushal Nov 24 '11 at 14:42
    
how do i know which entry I should delete, or can it be safe to say that each entry which say java is ok to delete? Like is the entire JavaSoft ok to remove (located in HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft)? – starcorn Nov 24 '11 at 15:17
    
ok after some play around, reinstall, uninstall, remove different stuff from registry, and restoring the registry, finally JDK7 works as it should work. I don't know what the problem still was though.... – starcorn Nov 24 '11 at 19:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .