0

I have installed java 1.7 and updated java_home to points java 1.7 but if I check it from windows cmd c://user//somefolder and type java -version it shows old one not 1.7

user3543851
  • 166
  • 3
  • 10

2 Answers2

4

Check your JAVA_HOME and PATH environment variables, are they correct?

(go in cmd and type set to see...)

PS. restart your windows command prompt if you had it open from before you updated to 1.7

vikingsteve
  • 38,481
  • 23
  • 112
  • 156
1

You are checking JAVA_HOME, but when you execute java.exe -version, the java.exe file is looked up in PATH variable. Most of the times PATH contains something like %JAVA_HOME%\bin, but in your case it might just point explicitly to the old JDK like C:\Program Files\Java\jdk1.6.0

  • Make sure that JAVA_HOME points to, say, C:\Program Files\Java\jdk1.7.0
  • Make sure that PATH begins with %JAVA_HOME%\bin