Skip to content
Related Articles

Related Articles

Improve Article

How to set Temporary and Permanent Paths in Java

  • Last Updated : 24 Mar, 2018
Geek Week

If the Java source file is inside the jdk/bin folder,path is not required to be set because the tools like javac,java are inside the current folder.
But if the java source file is outside the jdk/bin folder,path is required to be set in order to execute java source file.
There are two ways to set java path:

  1. Temporary
  2. Permanent
  1. Setting Temporary Java Path:

    To set temporary java path:

    • Open command prompt
    • Copy the path of jdk/bin directory
    • Write in command prompt:SET PATH=copied_path

    For example:

    SET PATH=C:\Program Files\Java\jdk1.7.0_79\bin

  2. Setting Permanent Java Path:

    To set permanent java path:



    1. Go to MyPC properties

    2. Click on Advanced system settings

    3. Click on Environment Variables

    4. Click on New tab of User variables

    5. Assign value Gfg_path to Variable name:

    6. Copy the path of bin folder

    7. Paste path of bin folder in Variable value:

    8. Click on OK button

    9. Click on OK button

      In this way Temporary and Permanent Path for Java can be set in Windows.

      Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more,  please refer Complete Interview Preparation Course.

      My Personal Notes arrow_drop_up
Recommended Articles
Page :