Where and how does the variable JAVA_HOME
go? What, specifically, should the environment
file contents be to correctly set JAVA_HOME
alongside PATH
?
current environment:
thufir@doge:~$
thufir@doge:~$ cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
thufir@doge:~$
Java settings:
thufir@doge:~$
thufir@doge:~$ java -version
openjdk version "1.8.0_121"
OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-0ubuntu1.16.10.2-b13)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
thufir@doge:~$
thufir@doge:~$ which java
/usr/bin/java
thufir@doge:~$
thufir@doge:~$ sudo update-alternatives --config java
[sudo] password for thufir:
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
Nothing to configure.
thufir@doge:~$
thufir@doge:~$ echo JAVA_HOME
JAVA_HOME
thufir@doge:~$
without editing the user profile.