Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setup JAVA_HOME vs JRE_HOME vs PATH environment variables

Do I need all three environment variables if I want to compile/run or just run Java applications in linux platform?

JAVA_HOME   export JAVA_HOME=/opt/jdk1.7.0_75
JRE_HOME    export JRE_HOME=/opt/jdk1.7.0_75/jre
PATH        export PATH=$PATH:/opt/jdk1.7.0_75/bin:/opt/jdk1.7.0_75/jre/bin
like image 978
DaeYoung Avatar asked Feb 12 '15 22:02

DaeYoung


1 Answers

No, you don't usually need JRE_HOME (may need to add it if other applications are looking for it, but I have never needed it). You do need JAVA_HOME because many applications (like Tomcat) look for this. Also, in your PATH, use $JAVA_HOME/bin; instead so that if you upgrade your Java, you don't have to change PATH as well :-)

like image 79
Ascalonian Avatar answered Oct 01 '22 06:10

Ascalonian