Considering these dominant features most of the developers, students, etc run java on their machines. However, most java users struggle to check where is java located. So, in this write-up we will assist you in this regard. So, let’s get started!
Where is Java Installed in Windows
You have to go through the below-given steps to check the location where java is installed on the Windows operating system.
First Step
Firstly, you need to check whether the java is installed on your Windows operating system or not! To do so, type the below-given command on the window’s command prompt:
If java is properly installed on your system, then you will encounter the following output:
Else if java is not installed on your system then, you will get the output something like this:
Maybe your output message differs a little bit because it depends on the java version that is installed on your operating system.
Second Step
If you don’t know how to install java, then visit this link that will assist you step-by-step in downloading and installing java on the windows operating system.
Third Step
Once you are sure that the java is installed on your system then you can check the java’s installation location by typing the below-given command:
Typing the above-mentioned command will show the following output:
The above snippet shows that java is located on the following path “C:\Program Files\Java\jdk-17.0.1”.
Fourth Step
If java is properly installed on your Windows, but still, you are unable to find the location of Java. This means you didn’t set the “JAVA_HOME” variable properly on your system.
To set up the Java_home variable, we have to follow the following steps:
- Search for the “view advanced system settings” in the window’s search bar and select it.
- Click on the Environment Variables.
- Select “User Variables” and click on “New” button.
- Type “JAVA_HOME” as the variable name and specify the path to JDK as the variable value.
- Locate the path variable and press OK.
- Repeat the whole process for “System Variables” and press OK.
- This process will set the Java_home variable on your windows operating system.
For detailed understanding of how to configure the java environment please visit this link: how to set the environment for java
Conclusion
Type echo %JAVA_HOME% in the windows command prompt to find the folder’s location where Java is installed. It will return the complete path of java’s installation folder e.g., “C:\Program Files\Java\jdk-17.0.1”. This write-up explained how to check if java is installed on Windows operating system or not. If installed! Then how to check where it is located.