I'm using a Windows .bat script and I set JAVA_HOME
as C:/Program Files/Java/jdk1.6.0_32
when I do a java -version
, it still shows the 1.3
How can I fix this? What am I doing wrong?
For me the issue was in my PATH variable, C:\ProgramData\Oracle\Java\javapath;
was added by java windows install before my %JAVA_HOME%\bin;
.
So I'd echo %JAVA_HOME%
pointing to a JDK7 and java -version
showing jdk8.
I'd to put %JAVA_HOME%\bin;
before C:\ProgramData\Oracle\Java\javapath;
so that java -version
displays jdk7.