Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

webupd8 JAVA_HOME not set after installing oracle-java8-set-default

I'm following this link to install Oracle Java 8.

Maybe I got this wrong, but I suppose JAVA_HOME should be set after installing oracle-java8-set-default.

If I echo $JAVA_HOME or printenv | grep -i java nothing comes up. I'm using Linux Mint 17.1 (Rebecca)

Thanks!

like image 910
resilva87 Avatar asked Mar 26 '15 01:03

resilva87


2 Answers

You need to run also the command:

sudo apt-get install oracle-java8-set-default

as described in WebUpd8 site, then you need to logout and login back again, since the specific command creates two files under /etc/profile.d, named jdk.sh and jdk.csh which populate the environment with JAVA_HOME etc.

like image 110
garfield Avatar answered Nov 05 '22 01:11

garfield


Your JAVA_HOME will not be set by the webupd8 method, and you don't normally need it (because the update-java-alternatives script manages the environment). If you're looking for the folder it's under "/usr/lib/jvm" and you can certainly do

export JAVA_HOME=/usr/lib/jvm/java-8-oracle

and you can also test which Java is active with

java -version

or

java -fullversion
like image 37
Elliott Frisch Avatar answered Nov 05 '22 03:11

Elliott Frisch