Table of Contents
How to set path in Java language
To Windows
After you’ve installed the Java Development Kit(JDK) in Windows, you must set the path in Java Environment variable to point out the JDK installation directory.
Default drive is Programming file in C Drive.
If you save the java source file inside the JDK/bin folder, this path is not required. Otherwise, if you save java source file in any other directory or folder(out side of the JDK/bin folder), it is required to set path to compile and run the java program.
Methods to set Java path
There are 2 methods to set java path
- temporary method
- permanent method
How to create a temporary path of JDK in windows
- Open command prompt – cmd
- copy the path of JDK/bin directory in C drive/program file
- Write in command prompt
set psth= C:Program FilesJavajdk1.8.0_45bin
How to create a permanent path of JDK in windows
if you like setting the permanent path of JDK, you must consider the following steps
1. Open my computer, click right mouse button and select properties
2. Click on Advanced system setting
Click on Environment Variable
Click the new button in the user variable
Write path in Variable name
Copy the path or Address of JDK bin folder
Paste path of bin folder in Variable value then click ok button
Then click on ok button
Then click OK button
Ok you set permanent path of Java for the run and compile on your PC
Related post