Inside, you will likely see folders like jdk-11 , jdk-17 , or jre1.8.0 .
Look for any entry that points to a Java \bin folder or uses %JAVA_HOME%\bin .
(Note: You must restart your terminal for this to take effect.) change java version windows
Now, to change versions, you just edit the JAVA_HOME variable to point to a different JAVA_HOME_X .
that points to one of them:
C:\Java\jdk-8 C:\Java\jdk-11 C:\Java\jdk-17
%JAVA_HOME%\bin
You must close and reopen any command prompts or terminals for changes to take effect.
Create a file switch-java.bat with this content: Inside, you will likely see folders like jdk-11
Before making changes, verify which version is currently active in your system.