How to Use the Script:
-
Save the script: Create a .bat file using the the script below and save it as usedjk.bat.
-
Move the bat file in environment path : Add the script path to user/system environment variable (optional)
-
Run the script: Open Command Prompt and navigate to the directory where you saved the script. (if #2 is not done)
-
Switch Java versions: Run the script with the desired Java version as an argument.
For example:
usejdk 8 usejdk 11