Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should JAVA_HOME point to JDK or JRE?

People also ask

Does JAVA_HOME point to JRE or JDK?

If you're doing any sort of development, or building with Maven or Ant, you need to point to the JDK (Java Development Kit) where utilities such as javac (the Java Compiler) reside. Otherwise, you can point to the JRE (Java Runtime Environment). The JDK contains everything the JRE has and more.

Where should the JAVA_HOME point?

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.

Which is better Java or Java home?

home is a system variable created based on Java Runtime Environment (JRE). This is more like a system variable. JAVA_HOME is an environment variable, this is required when you install JDK.

Does JAVA_HOME need to be in path?

Some modern programs are intelligent enough to extract the JDK location from PATH if JAVA_HOME is not set. For example, with Gradle you can set either PATH or JAVA_HOME and it will run fine. Other programs, such as the Eclipse IDE, need at least the PATH in order to startup.


If you're doing any sort of development, or building with Maven or Ant, you need to point to the JDK (Java Development Kit) where utilities such as javac (the Java Compiler) reside. Otherwise, you can point to the JRE (Java Runtime Environment).

The JDK contains everything the JRE has and more. If you're just executing Java programs, you can point to either the JRE or the JDK.


Simply (change to your jdk1.x.x.x_xx)

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_05


My JAVA_HOME points to the JDK. If it still doesn't work, check if you downloaded ant for Java 7 and not for Java 6.


Generally, it does not matter if you point it at JRE or JDK. It depends on the application which uses it. Ant documentation says you should point it at JDK to get all Ant's features.