13

I wanted to get Java running at 1.6xxx - I changed the JAVA_HOME variable and pointed it to the directory C:\Program Files\Java\jdk1.6.0._16.

I restart the PC - and I think I can check which version of Java my machine is pointing at - but it still points to the older version of Java e.g v1.5.0_16

Can you help me rejog my memory on correct setup for Java JDK?

java home

2
  • 1
    check your PATH variable and see which version of java is present on that. Commented Sep 29, 2010 at 11:03
  • I have tried changing the PATH variable and JAVA_HOME variable to point to the same dir - but I still get the same result using the java -version command - 1.5.0.16 etc. Commented Sep 29, 2010 at 12:26

4 Answers 4

8

You need to reset your path variable to point to 1.6

something like
alt text

Additionally, make sure the variable JAVA_HOME is also set with the above location.

Sign up to request clarification or add additional context in comments.

16 Comments

My Java_Home and my Path Varaible point to the java version 1.6.0_19, but in the cmd java -version shows me java version 1.6.0_20. Because i made an update via the java-Updater?
@cuh java-Updater !! interesting, how ? which O.S. ?
Windows 7. In the jre/bin Directory start Java Control Panel: javacpl. you can (de-)activate automatic update notifications. My Path points to jdk 1.6.0_19 but java in cmd is linked to the jre6 version 1.6.0_20.
@cuh: Is there is a java (a different one) in your system folder by any chance?
@Vidar I would strongly recommend you to simply delete that dir, and install it from standard setup.
|
6

JAVA_HOME is used by other applications, such as Tomcat. Windows just checks the PATH environment variable for locations where it can find the java executable.

Comments

0

Try this on the cmd shell:

> java -version
java version "1.5.0_16"
> set PATH=%JAVA_HOME%\bin;%PATH%
> java -version

3 Comments

That wouldn't work since you are appending %JAVA_HOME%\bin after the existing path list - Windows will still find the older java.exe first. Should be set PATH=%JAVA_HOME%\bin;%PATH% instead.
@Peter, agree, didn't pay attention, the old Java was on the path so it has to be added at the beginning for this demo. But obviously, replacing the old entry is the norma solution ;)
Yes indeed. Btw I wasn't the downvoter - I think your demo idea is good and this issue is trivial to fix.
0

This Image will explain all steps. enter image description here

For More Explanation

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.