@echo offSetRegpath=hkey_local_machine\system\currentcontrolset\control\session Manager\EnvironmentSetJavahome=D:\Java\jdk1.7.0_40Echo.Echo ************************************************************Echo * *Echo* JDK System environment variable setting *Echo * *Echo ************************************************************Echo.Echo# Prepare to set environment variable: java_home=%javahome%Echo# Note: If Java_home exists, it will be overwritten, this action is irreversible,Please check the confirmation carefully!Echo.Echo# Prepare to set environment variables (there is a.): Classpath=%%java_home%%\lib\tools.jar;%%java_home%%\lib\dt.jar;.Echo# Note: If classpath exists, it will be overwritten, this action is irreversible,Please check the confirmation carefully!Echo.Echo# Prepare to set environment variables:PATH=%%java_home%%\binEcho# Note: path is 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%%\bin for/F "tokens=1,* delims=:"%%a in (' Reg QUERY '%regpath% "/V" path ") Do(Set"L=%%a"Set"P=%%b")Set"y=%l:~-1%:%p%"setxPath"%%java_home%%\bin;%y%"- MEcho.Echo.EchoPlease press any key to exit ...Pause>nul
"Development environment" JAVA Environment Variables batch processing