Breaking

Friday 29 March 2019

How to set path in java | Java Tutoriyal | How to set Temporary Path of JDK in Windows


How to set path in java

The way is required to be set for utilizing devices, for example, javac, java, and so on.



On the off chance that you are sparing the Java source document inside the JDK/canister index, the way isn't required to be set since every one of the apparatuses will be accessible in the present registry.

In any case, in the event that you have your Java document outside the JDK/canister organizer, it is important to set the way of JDK.

There are two different ways to set the way in Java:
1.       Temporary
2.       Permanent

How to set Temporary Path of JDK in Windows


To set the temporary path of JDK, you need to follow the following steps:
  • Open the command prompt
  • Copy the path of the JDK/bin directory
  • Write in command prompt: set path=copied_path
For Example : -

set path=C:\Program Files\Java\jdk1.6.0_23\bin

Let’s seeit in the figure given below :




How to set permanent Path of JDK Windows
For setting the permanent path of JDK, you need to follow these steps:
  • Go to MyComputer properties -> advanced tab -> environment variables -> new tab of user variable -> write path in variable name -> write path of bin folder in variable value -> ok -> ok -> ok
For Example :-

1 Go to MYComputer Properties



2 Click on The Advanced tab



3 Click On environment variable



4 Click on the new tab of user variable


5 Write the path in the variable name


6 Copy the path of bin folder



7 Past path of bin folder in the variable value

8 Click on Ok Button



9 Click on Ok Button


Now your permanent path is set. You can now execute any program of java from any drive.

Setting Java Path in Linux OS

Setting path in Linux OS is the same as setting the path in the Windows OS. But, here we use the export tool rather than set. Let's see how to set path in Linux OS:

export PATH=$PATH:/home/jdk1.6.01/bin/


No comments:

Post a Comment