Last active
August 29, 2015 13:58
-
-
Save mperry/9999570 to your computer and use it in GitHub Desktop.
Switches java versions and add the new JAVA_HOME to the front of the PATH.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set VERSION=%1 | |
call setEnvVar JAVA_HOME JAVA%VERSION%_HOME | |
echo JAVA_HOME=%JAVA_HOME% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set WRITE=%1 | |
set READ=%2 | |
:main | |
call :myset %WRITE% %%READ%% | |
goto :end | |
:myset | |
for /F "usebackq tokens=*" %%i in (`echo %%%2%%`) do set %1=%%i&& set PATH=%%i\bin;%PATH% | |
goto :eof | |
:end | |
set WRITE= | |
set READ= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment