This repository contains a Windows batch script for switching between different JDK versions directly from the command line. It simplifies the process of managing multiple Java Development Kits on your system.
Before using the scripts, ensure you have multiple versions of the JDK installed on your Windows machine.
To use the script from the command line, follow these steps to add the scripts' folder to your environment variables:
- Open the Start Search, type in
Environment Variables
, and select Edit the system environment variables. - In the System Properties window, click on the Environment Variables button.
- Under the System variables section, scroll down and select the Path variable, then click Edit.
- In the Edit Environment Variable window, click New and add the path to the folder that contains the scripts.
- Click OK on all windows to apply the changes.
Once the setup is complete, you can easily switch between JDK versions by opening Command Prompt (CMD) and typing JDK
followed by the version number you wish to activate. For example:
- To switch to JDK 8, type
JDK8
. - To switch to JDK 11, type
JDK11
.
Replace "8" and "11" with the version number you need to switch to, based on the JDK versions you have installed.
Feel free to fork this repository and submit pull requests to contribute to its development. For major changes, please open an issue first to discuss what you would like to change.
Distributed under the MIT License. See LICENSE
for more information.
- This script was inspired by the need to easily switch between multiple JDK versions for various development projects.
Visit the repository: JDK_Script for more information and updates.