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.
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:
ii) System and Security:
iii) System:
iv) Advance System Setting:
4. Under the advance system setting click on the environment variable.
5. After clicking the environment variable Go to the System variable -> click on the path -> edit
iv) bin:
v) Copy this location:
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.
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.
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
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.
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:
ii) System and Security:
iii) System:
iv) Advance System Setting:
4. Under the advance system setting click on the environment variable.
5. After clicking the environment variable Go to the System variable -> click on the path -> edit
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:
ii) Java Folder:
iii) JDK:
v) Copy this location:
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.
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.
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
Reviewed by Prashant Srivastava
on
December 12, 2019
Rating:

No comments: