why is SET JAVA_HOME in this bat file not overriding the environment variable JAVA_HOME?
someFile.bat
@ECHO OFF
SET JAVA_HOME = Progra~2\Java\jdk1.6.0_23
echo JAVA_HOME: %JAVA_HOME%
OUTPUT
JAVA_HOME: C:\Program Files (x86)\Java\jdk1.7.0_21
because of the additional space.Try this to see the value you've set:
echo JAVA_HOME: %JAVA_HOME %
A robust way to set the java_home :
SET "JAVA_HOME=Progra~2\Java\jdk1.6.0_23"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With