468,167 Members | 1,931 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,167 developers. It's quick & easy.

How to set path in java

Hi Guys,

can anybody explain me how to set temporary and permanent path in java
Oct 6 '17 #1
5 4382
chaarmann
785 Expert 512MB
Temporary:
If you open the command line, you can set the environment variables PATH and CLASSPATH before starting the java compiler.

permanent:
You can give a value to the environment vaiables in windows under advanced sytsem settings.
Oct 9 '17 #2
PATH can be set using the system utility in the Windows Control Panel or by using the Linux and Solaris shell startup file. On computers running Windows or Mac OS X, you do not normally need to make changes to PATH. If you can't configure it, you can use or read tutorial on this topic https://docs.oracle.com/javase/tutor...ent/paths.html.
Apr 2 '18 #3
To set the temporary path of JDK, you need to follow following steps:

1- Open command prompt
2- Copy the path of jdk/bin directory
3- Write in command prompt: set path=copied_path

For Example:

set path=C:\Program Files\Java\jdk1.6.0_23\bin
Apr 2 '18 #4
I'm using Windows 8.1, and I have both JDK6 and JDK8 installed. For development purposes, I needed to get the java version "1.6.0_45" at the command java -version and javac 1.6.0_45 over javac -version. The second command worked as expected after installing JAVA_HOME as the JDK6 start folder and adding% JAVA_HOME / bin% to Path. However, the first command still returned the java version "1.8.0_71"
Solution was necessary for my programing
Troubleshoot problems

I could find an entry in the Path environment variable that points to C: \ ProgramData \ Oracle \ Java. This folder actually contains a short link to java.exe JDK8.

The Correct Solution: Remove JDK 8

Workaround: edit the short message file so that it points to java.exe inside% JAVA_HOME% \ bin (Please replace the variable with the actual folder)
May 10 '18 #5
Ishan Shah
47 32bit
You should follow the following steps to set the java path:

1) Type advanced system setting in the serach field
2) Click on the View advanced system settings
3) System property windows will get open, then click on Environment Variables
4) In system variables click on the New button and enter JAVA_HOME as varible name and the path of your java JDK directory in Variable value
5) Update System PATH by select path under System varibales
6) Then click on Edit
7) In the Edit Environment Variable window click on New
8) then type in %JAVA_HOME%\bin
9) Tests your configuration by opening a new command prompt and type in "echo %JAVA_HOME%" then type in it: "javac -version" to check the java version
Dec 10 '20 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Hal Vaughan | last post: by
2 posts views Thread by Daya Kiran Sunkara | last post: by
2 posts views Thread by Janna | last post: by
reply views Thread by Hotice | last post: by
1 post views Thread by gcdp | last post: by
reply views Thread by kamranasdasdas | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.