- @echo off
- wmic /? >nul
- rem wmic environment where Name="PATH" set VariableValue="%PATH%;%%JAVA_HOME%%\bin"
- wmic environment create UserName="<system>",Name="CLASSPATH",VariableValue="%%JAVA_HOME%%\lib"
- wmic environment create UserName="<system>",Name="JAVA_HOME",VariableValue="C:\Program Files\Java\jdk1.6.0_18"
- wmic environment create UserName="%USERNAME%",Name="PATH",VariableValue="%%JAVA_HOME%%\bin"
- pause
复制代码
|