Original: Bat Batch settings Java JDK system environment variable file
Modify the Java installation directory on line 3rd to set Java_home, ClassPath, append to the front of path
Java_home=c:\program files\java\jdk1.6.0_10
Classpath=%java_home%\lib\tools.jar;%java_home%\lib\dt.jar;.
Path=%java_home%\bin, ....... Append to the front of path (solve the problem that there should not be a semicolon at the end.) Oh. Leave the question to others
Here you can download http://download.csdn.net/detail/lpy3654321/5887509
We have questions, please leave a message
@echo Offset Regpath=hkey_local_machine\system\currentcontrolset\control\session Manager\environmentset Javahome=C : \program Files\java\jdk1.6.0_10rem Lpyecho.echo ************************************************************echo * *echo * JDK system environment variable settings *echo * *echo ********************************************************* Echo.echo = = = Ready to set environment variable: Java_home=%javahome%echo = = = Note: If java_home exists, it will be overwritten, this operation is irreversible, please check the confirmation carefully!! ===echo.echo = = = Ready to set the environment variable (there is a.): Classpath=%%java_home%%\lib\tools.jar;%%java_home%%\lib\dt.jar;. echo = = = Note: If classpath exists, it will be overwritten, this operation is irreversible, please check the confirmation carefully!! ===echo.echo = = = Ready to set environment variable: Path=%%java_home%%\binecho = = = Note: PATH will be appended to the front, echo.set/p en= please confirm and press ENTER to start setting! Echo.echo.echo.echo.echo = = = New Create environment variable Java_home=%javahome%setx "Java_home" "%javahome%"-mecho.echo.echo = = = Newly created environment variable Classpath=%%java_home%%\lib\tools.jar;%%java_home%%%\lib\dt.jar;. Setx "ClassPath" "%%java_home%%\lib\tools.jar;%%java_home%%%\lib\dt.jar;."-mecho.echo.echo = = = new APPEND environment variable (append to front) PATH =%%java_home%%\binfor/f "tokens=1,* delims=:"%%a in (' Reg QUERY '%regpath% "/V" path "') Do (set" L=%%a "Set" p=%% B ") set" y=%l:~-1%:%p% "Setx path"%%java_home%%\bin;%y% "-mecho.echo.rem lpy Zeus http://write.blog.csdn.net/postedit/ 9822439echo = = Please press any key to exit! Pause>nul
@@
BAT Batch Settings Java JDK system environment variable file