Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I add both JAVA_HOME and JRE_HOME in environmental variable, PATH?

Tags:

People also ask

What is the difference between JAVA_HOME and JRE_HOME?

Thanks in Advance. - JAVA_HOME: must point to installation directory of JDK. - JRE_HOME: must point to installation directory of JRE. - CLASSPATH: contains libraries path which JVM will look for.

Do we need to add JAVA_HOME to path?

If you are not using software that requires them, you do not need to set JAVA_HOME and JRE_HOME. CLASSPATH is an environment variable which contains a list of directories and / or JAR files, which Java will look through when it searches for Java classes to load.

Should JAVA_HOME point to JDK or JRE?

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.

What path should be set JAVA_HOME?

To set JAVA_HOME, do the following: 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.


I ran into this error while setting up my Tomcat and Java environmental path:

Neither the JAVA_HOME nor the JRE_HOME environmental variables is defined. At least one of the 2 environmental variables is needed to run this program.

In the user variables: I created JAVA_HOME variables and add C:\Program Files\Java\jdk1.8.0_25 to its path. and then did an edit of system variable PATH, added C:\Program Files\Java\jdk1.8.0_25; to the beginning of the its path. I also created JRE_HOME in user variable and added C:\Program Files\Java\jre1.8.0_25 to its path.

Is it necessary to create JRE_HOME and should I add the JRE path to the system variable also?