Java Home ¶
If you are getting java_home is not defined correctly in Ubuntu, then you are at right place.
I was getting this error as I was trying to update the Java home in ~\.bashrc and ~\.bash_profile. Follow these steps to solve this issue.
-
Open the
/etc/environmentfile asvim /etc/environment -
Then set
java_homeusingJAVA_HOME="/usr/lib/jvm/java-8-oracle" export JAVA_HOME -
Open bash profile as
vim ~\.bash_profile -
Then add the following,
. /etc/environmentIt will load the
/etc/environmentevery time terminal is started -
Then confirm the path using
echo $JAVA_HOME