how to find installed jdk and set JAVA_HOME evinronment
$locate jdk
/usr/lib/jvm/java-7-openjdk-i386/bin/java
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/"
/usr/lib/jvm/java-7-openjdk-i386/bin/java
You can set your
Open
Use
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 followingJAVA_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
Post a Comment