To set java JDK path to the environment variable in Windows 11 | 10; Simply type environment variable in the search bar and click on it, after click on the Advanced tab, select Environment Variables, and set the java JDK path under System Variables by clicking on Edit and selecting New path, then setting the path to your java JDK and save it.
If you have installed Java in your Windows system. To use Java, you must first add the JAVA PATH environment variable to the system. Otherwise, it will be shown to you java is not recognized as an internal or external command in command prompt windows 11|10.
How to Set Java Path to System Environment Variable in Windows 11|10
Here are the steps on how to set the JAVA jdk path to the system environment variable in Windows 11 | 10:
Step 1 – Start Windows Search Bar
First of all, start window search bar and type Environment Variables and click in it; as shown below picture:
Step 2 – Environment Setting
Then Click on the environment variable setting; as shown below picture:
Step 3 – Edit System Environment Variable Path
Edit system environment variable path; as shown below picture:
Step 4 – Set Java Path to System Environment Variable Windows
To set java path in system environment variable; as shown below picture:
Step 5 – Restart Windows 10
Restart Windows 10/11 system.
You can also set the JAVA PATH in the system environment variable on the Windows 11 | 10 command prompt, Simply open your CMD and type the command set path=C:\Program Files\Java\jdk-21\bin
and press enter, this will temporarily add the JAVA JDK path to the system environment variable:
set path=C:\Program Files\Java\jdk-21\bin
Conclusion
Through this tutorial, we have learned how to add java path to system environment variable in windows 11/10.