设置环境变量批处理

@echo off
rem 获取当前路径
set CurrentPath=%~dp0
echo %CurrentPath%
rem cd /d %CurrentPath%
rem ========================================================
rem 设置用户环境变量
setx JAVA_HOME "%CurrentPath%jdk1.8.0_162"
setx CLASSPATH ".;%%JAVA_HOME%%\lib;%%JAVA_HOME%%\lib\dt.jar;%%JAVA_HOME%%\lib\tools.jar"
setx ANT_ROOT "%CurrentPath%apache-ant-1.10.2\bin"
setx ANDROID_SDK_ROOT "%CurrentPath%android-sdk"
setx NDK_ROOT "%CurrentPath%android-ndk-r10e"
setx path "%%JAVA_HOME%%\bin;%%JAVA_HOME%%\jre\bin;%%ANT_ROOT%%;%%ANDROID_SDK_ROOT%%\tools;%%ANDROID_SDK_ROOT%%\platform-tools;%%NDK_ROOT%%;%CurrentPath%Python27;%CurrentPath%WinRAR;%CurrentPath%cocos2d-x\templates;%CurrentPath%cocos2d-x\tools\cocos2d-console\bin"
rem ========================================================
pause

 

你可能感兴趣的:(设置环境变量批处理)