1

I had installed jdk-6u18-windows-i586 on my machine. Later on I uninstalled it and installed jdk 1.5.0_13 instead.

Now when I do javac -version I get

jdk 1.5.0_13

But when I do java -version I get

java version "1.6.0_19"

How do I fix this?

9
  • what is under c:\program files\Java ?
    – Bozho
    Apr 6, 2010 at 11:09
  • Your question is better suited for superuser.com Apr 6, 2010 at 11:10
  • @Bozho jdk1.5.0_13 and lots of jre installations
    – Jack
    Apr 6, 2010 at 11:12
  • one of which is, I guess, 1.6.0_19
    – Bozho
    Apr 6, 2010 at 11:13
  • No I have jre1.5.0_12 , 0_13, 0_15, jre6
    – Jack
    Apr 6, 2010 at 11:15

4 Answers 4

1

Remove the java s/w in the registers by going the "regedit" from the run command. Later u install the jdk 1.5.0_13 of java it will work.

1

Multiple JREs and JDKs can be installed on one machine. You are having JDK 1.5, but you have JRE 1.6.0_19.

And the version that is called from command line depends on the environment variables. Go and check your environment variables. check PATH, JAVA_HOME, JRE_HOME.

2
  • My JAVA_HOME is set to C:\Program Files\Java\jdk1.5.0_13...I dont have a JRE_HOME environment variable
    – Jack
    Apr 6, 2010 at 11:18
  • @Jack - check PATH
    – Bozho
    Apr 6, 2010 at 11:24
1

As the others have suggested, it looks like you have the 1.6 Java runtime hanging around.

Check your PATH and you should see the JRE location.

Assuming you don't need it any more, go to Control Panel | Add or Remove Programs and delete the unwanted JRE (which will have the Java icon and J2?? Runtime Enviroinment in its name).

1

Which Java is called when you do java -version is controlled exclusively by the PATH; the first java.exe that can be reached from the PATH will be.

Other than trying to do a more clean "uninstall," what you can do is modify your PATH (in System|Properties...) to point first to the Java that you want called.

You must log in to answer this question.

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