Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JAVA_HOME or PATH or BOTH?

I was watching the Android development video and they asked us to install JDK and create JAVA_HOME environment variable. I already have MyEclipse installed and I previously had setup the PATH variable(giving it the directory of JDK), do I still need a JAVA_HOME variable ??? If yes then why ???

like image 738
shubham srivastava Avatar asked Jul 21 '17 20:07

shubham srivastava


People also ask

What is the correct JAVA_HOME path?

Set JAVA_HOME: Right click My Computer and select Properties. On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1. 6.0_02.

Why should I set JAVA_HOME?

By setting the environment variable JAVA_HOME you specify where the JRE, and hence all those runtime resources, are to be found. You should ensure that the particular Java you execute matches the setting of JAVA_HOME.

Is JAVA_HOME required?

Any Java-written program will require a Java-based environment in which to run. Programs that require the JAVA_HOME variable to be configured properly include: Eclipse, NetBeans and Android Studio. Apache Tomcat and WebSphere Portal.

Should Java be in path?

For JAVA_HOME it should be C:\java , but on your Path variable, it should point to C:\java\bin\ since Path is what is used to tell the Command Prompt where to look for executables. You may want to try %JAVA_HOME%\bin to keep it consistent.


1 Answers

If the application you are using is looking for a specific dataset in the JAVA_HOME environment variable and it isn't there, it is not going to be happy.

Other applications might look for the JDK path in the PATH environment variable, but just because you have it there doesn't mean it will work for other applications that need it in a separate variable.

like image 162
ifconfig Avatar answered Nov 04 '22 16:11

ifconfig