how to find installed jdk and set JAVA_HOME evinronment

$locate jdk
/usr/lib/jvm/java-7-openjdk-i386/bin/java

You can set your JAVA_HOME in /etc/profile as Petronilla Escarabajo suggests. But the preferred location for JAVA_HOME or any system variable is /etc/environment.
Open /etc/environment in any text editor like nano or gedit and add the following
JAVA_HOME="/usr/lib/jvm/open-jdk" (java path could be different)
Use source to load the variables, by running this command:
source /etc/environment
Then check the variable, by running this command:
echo $JAVA_HOME


cat environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
JAVA_HOME="/usr/lib/jvm/java-7-openjdk-i386/"


Comments

Popular posts from this blog

HAproxy logging

tomcat catalina coyote jasper cluster

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all