How to Set Path in Java | Java Environment Set Up on Window

In the previous tutorial, we learned how to download JDK on a window, and install JDK on the window. In this tutorial, we will learn how to set path in Java? Below are the steps to set the environment variables for Java in Windows.

1. First, you need to download the latest version of JDK. You can download the JDK from the official website(here). For downloading the JDK, you need to accept the Oracle License agreement and click on the link as highlighted below for the window.


Set Path in Java

2. Once you download and install JDK, you have set up the environment variable. 


3. Right-click on windows Go to Control Panel -> System and Security-> System -> Advance system setting. 

i) Control Panel:
Set Path in Java
ii) System and Security:
Set Path in Java
iii) System:
Set Path in Java

iv) Advance System Setting:
Set Path in Java

4. Under the advance system setting click on the environment variable.
Set Path in Java
5. After clicking the environment variable Go to the System variable -> click on the path -> edit

Set Path in Java


6. We need to add the path in the variable value(you need to copy the location where you have installed is java) so Go to program files -> Java folder -> JDK(Here we have multiple JDK, you can select anyone) -> bin -> copy this location(for ex: C:\Program Files\Java\jdk1.8.0_151\bin)


i) Program File:

Set Path in Java

ii) Java Folder:

Set Path in Java

iii) JDK:

Set Path in Java


iv) bin:
Set Path in Java



v) Copy this location:
Set Path in Java



7. Paste the path in the variable value, which you have copied(C:\Program Files\Java\jdk1.8.0_151\bin) and click on OK, save the setting and you are done.
Set Path in Java
8. Now to check whether the path successfully set up or not, type the javac command on the command prompt. If you will see the list related to javac, then the path is successfully set up on your window. 
Set Path in Java



You may also like these related posts:
1. Top 100 Core Java Interview Questions and Answers.

2. Java Collection Framework complete tutorial.
3. Java OOPs - Class & Objects with Example.
4. What is Java Beans?
5. Java Serialization complete tutorial

How to Set Path in Java | Java Environment Set Up on Window How to Set Path in Java | Java Environment Set Up on Window Reviewed by Prashant Srivastava on December 12, 2019 Rating: 5

No comments:

Powered by Blogger.