Thursday, October 16, 2025
HomeLanguagesJavaHow to set Temporary and Permanent Paths in Java

How to set Temporary and Permanent Paths in Java

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:
  2. 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

  • 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
    10. In this way Temporary and Permanent Path for Java can be set in Windows.
    RELATED ARTICLES

    Most Popular

    Dominic
    32361 POSTS0 COMMENTS
    Milvus
    88 POSTS0 COMMENTS
    Nango Kala
    6728 POSTS0 COMMENTS
    Nicole Veronica
    11892 POSTS0 COMMENTS
    Nokonwaba Nkukhwana
    11953 POSTS0 COMMENTS
    Shaida Kate Naidoo
    6852 POSTS0 COMMENTS
    Ted Musemwa
    7113 POSTS0 COMMENTS
    Thapelo Manthata
    6805 POSTS0 COMMENTS
    Umr Jansen
    6801 POSTS0 COMMENTS