
How to Setup Environment Variables for JAVA in Windows 11?
28 June 2023If you have installed Java on Windows 11 and are facing an error like this, “The term ‘Java’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.” So, don’t worry, this tutorial helps you to setup environmental variables in Windows 11. The environment variable is a variable that is used by the system to locate the installation path and other system preferences.
There are two types of Environmental Variables :-
- System-Specific Variable
- User-Specific Variable
Setup Environmental Variables for Java
After downloading and installing JDC(Java Development Kit) on your system. You can see that java files are not work because you have to specify the Java installation path on the environment variables. So the system can execute Java code in your Windows system.
Steps to Setup Environmental Variables :
Step 1 : Open the C Drive and Click on Program Files.
Step 2 : In program files search and click on JAVA Folder.
Step 3 : Inside the Java Folder you will find a JDK folder, Open it.
Step 4 : Now click on jdk-20 Folder and copy the path
Step 5 : After that click on start button and search for Edit the environment system variables.
Step 6 : Open it and click on Environment Variables.
Step 7: You will get two variables option. One is for user variables and system variables. Under the system variable section, select the “Path” variable and click on the “Edit” button.
Step 8 : Now you can see a new interface where you have to click on “New” and add the bin folder location. After that, click on “OK” to save the changes.
Step 9 : Now, you have successfully installed it. To verify, open the command prompt and run the command.
If the command returns the currently installed version of Java, that means; the Java environment variable is fully setup on your Windows system.
Thanks for reading. We hope that you setup your java environment variables. If you have any queries related to this article, leave a comment down below!
Suggested Readings!
Hey there, I’m Anshul Pal, a tech blogger and Computer Science graduate. I’m passionate about exploring tech-related topics and sharing the knowledge I’ve acquired. With two years of industry expertise in blogging and content writing, I’m also the co-founder of HVM Smart Solution. Thanks for reading my blog – Happy Learning!