Skip to content

Instantly share code, notes, and snippets.

@velizarn
Last active August 29, 2015 14:09
Show Gist options
  • Save velizarn/7b6916cdaa7f30b2c9ff to your computer and use it in GitHub Desktop.
Save velizarn/7b6916cdaa7f30b2c9ff to your computer and use it in GitHub Desktop.
Select Java version and then start Eclipse executable file located in the same directory with runtime parameters "-clean" and "-vm" according to selected JDK.
@echo off
:chooseversion
set /p javaVersion=Please choose Java version (type 6, 7, 8 or 0 for exit): %=%
IF "%javaVersion%" == "6" (
start /d %CD% eclipse.exe -clean -vm "C:/Program Files/Java/jdk1.6.0_45/bin/javaw.exe"
) ELSE IF "%javaVersion%" == "7" (
start /d %CD% eclipse.exe -clean -vm "C:/Program Files/Java/jdk1.7.0_45/bin/javaw.exe"
) ELSE IF "%javaVersion%" == "8" (
start /d %CD% eclipse.exe -clean -vm "C:/Program Files/Java/jdk1.8.0_25/bin/javaw.exe"
) ELSE IF "%javaVersion%" == "0" (
quit
) ELSE (
echo Invalid value
goto chooseversion
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment