Wednesday, July 3, 2024
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.
    Nokonwaba Nkukhwana
    Experience as a skilled Java developer and proven expertise in using tools and technical developments to drive improvements throughout a entire software development life cycle. I have extensive industry and full life cycle experience in a java based environment, along with exceptional analytical, design and problem solving capabilities combined with excellent communication skills and ability to work alongside teams to define and refine new functionality. Currently working in springboot projects(microservices). Considering the fact that change is good, I am always keen to new challenges and growth to sharpen my skills.
    RELATED ARTICLES

    LEAVE A REPLY

    Please enter your comment!
    Please enter your name here

    Most Popular

    Recent Comments