Doesn't work macros for environment variables in Windows 7 -


I have set the JAVA_HOME variable> and I also define the path variable: < / P>

  c: \ & gt; Set java_home JAVA_HOME = C: \ Program Files \ Java \ jdk1.6.0_38 C: \ & gt; Path Set Path = C: \ Windows \ system32; C: \ WINDOWS; C: \ WINDOWS \ System32 \ Wbem; C: \ WINDOWS \ System32 \ WindowsPowerShell \ v1.0 \; C: \ Program Files \ rtoiseSVN \ bin;% JAVA_HOME% \ bin; C: \ Program Files \ Apache \ Apache-Maven -3.2.3 \ bin Patwox = com; .exe; Bt; CMD ;. VBS ;. VBE; .js; .jse; wsf; .wh; MSc C: \ & GTAWarsson Java \ 'is not recognized as an internal or external command, operational program or batch file. C: \ & gt;  

This way Java is not recognized.

Let's change a little change (% JAVA_HOME% \ bin with C: \ Program Files \ Java \ jdk1.6.0_38 \ bin ):

  C: \ & gt; Set java_home JAVA_HOME = C: \ Program Files \ Java \ jdk1.6.0_38 C: \ & Gt; Set Path Path = C: \ Windows \ system32; C: \ wINDOWS; C: \ wINDOWS \ system32 \ wbem; C: \ wINDOWS \ system32 \ Windows Power Shield \ v1.0 \; C: \ Program Files \ RtoiseSVN \ bin; C: \ Program Files \ Java \ jdk1.6.0_38 \ bin; C: \ Program Files \ Apache \ apache-maven-3.2.3 \ bin PATHEXT = .COM; .EXE; .bat; .CMD; .VBS ;. VBE; .js; .jse; .sf; .h ;. MSc C: \ & gt; Java-version Java version "1.6.0_38" Java (TM) SE runtime environment (build 1.6.0_38-B05) Java hotspot (TM) 64-bit server VM (build 20.13-B02, mixed mode)  

This is working well like this.

What do I do?

"% JAVA_HOME% \ bin" is the valid directory name CMD will need to evaluate its value before using it.

  call set path =% path%  

should work


path The system is loaded with the system value, then merged with the 'user'. Value, when any% var% in the path is replaced with its current value, if you add any other % var% in the path (for example, "user" as the variable) , Then you need to re-evaluate to solve the value.

The result is: Set the path as a system variable, there is a user variable if there is a value to solve it.


Comments