You need to specify the path to use tools such as Javac, Java and so on. If you store Java source files in the JDK/bin directory, you do not need to set the path because all tools are in the current directory. However, if Java files are not located in the JDK/bin folder, you must set the path of the JDK.
The two ways of setting path in Java are Temporary and Permanent.
1) How to set the Temporary Path of JDK in Windows
To set the JDK path temporarily, follow the given steps:
Copy the path of the JDK/bin directory
Open the Command prompt
Write the command in the command prompt as: set path=” Your copied path here”