Last active
April 19, 2019 09:10
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 | |
rem set JDK_BASE=%PROGRAMFILES%\Java | |
set JDK_BASE=%PROGRAMFILES%\Amazon Corretto | |
rem set JDK_BASE=%USERPROFILE%\.sdkman\candidates\java | |
if "%~1" == "" goto list | |
set JDK_TEMP=%JDK_BASE%\jdk%~1 | |
rem set JDK_TEMP=%JDK_BASE%\%~1 | |
if not exist "%JDK_TEMP%" goto error | |
set JAVA_HOME=%JDK_TEMP% | |
goto end | |
:list | |
dir "%JDK_BASE%\*" | |
goto end | |
:error | |
echo ---- | |
echo Not exist %JDK_TEMP% | |
:end | |
echo ---- | |
echo JAVA_HOME=%JAVA_HOME% | |
"%JAVA_HOME%\bin\java" -version | |
set JDK_BASE= | |
set JDK_TEMP= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment