423,849 Members | 1,901 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,849 IT Pros & Developers. It's quick & easy.

How to set path in java

P: 5
Hi Guys,

can anybody explain me how to set temporary and permanent path in java
Oct 6 '17 #1
Share this Question
Share on Google+
4 Replies

Expert 100+
P: 778
If you open the command line, you can set the environment variables PATH and CLASSPATH before starting the java compiler.

You can give a value to the environment vaiables in windows under advanced sytsem settings.
Oct 9 '17 #2

P: 1
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

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

P: 1
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

Post your reply

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