

- Java download ubuntu 16.04 oracle how to#
- Java download ubuntu 16.04 oracle manual#
- Java download ubuntu 16.04 oracle upgrade#
Java download ubuntu 16.04 oracle upgrade#

You can now test whether the environment variable has been set by executing the following command: $ echo $JAVA_HOME Repeat the above for: sudo update-alternatives -config javacĪTH=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/game$ JAVA_HOME=”/usr/lib/jvm/jdk-9.0.4″ $ source /etc/environment
Java download ubuntu 16.04 oracle manual#
Update-alternatives: using /usr/lib/jvm/jdk1.8.0/bin/java to provide /usr/bin/java (java) in manual mode Press enter to keep the current choice, or type selection number: 3 * 2 /usr/lib/jvm/jdk1.7.0/bin/java 1 manual modeģ /usr/lib/jvm/jdk1.8.0/bin/java 1 manual mode There are 3 choices for the alternative java (providing /usr/bin/java).Ġ /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 auto modeġ /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 manual mode You will see output similar to the one below – choose the number of jdk-9.0.4 – for example 3 in this list (unless you have have never installed Java installed in your computer in which case a sentence saying “There is nothing to configure” will appear): $ sudo update-alternatives -config java Run: $ sudo update-alternatives -config java This answer lists the other executables available. java, javac, javaws are probably the most frequently required. N.B.: Remember – Java JDK has many more executables that you can similarly install as above. $ sudo chown -R root:root /usr/lib/jvm/jdk-9.0.4 Be sure to use a higher priority if you want Oracle JDK to remain the default.Ĭorrect the file ownership and the permissions of the executables: $ sudo chmod a+x /usr/bin/java This will assign Oracle JDK a priority of 1, which means that installing other JDKs will replace it as the default. $ sudo update-alternatives -install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk-9.0.4/bin/javaws" 1 $ sudo update-alternatives -install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk-9.0.4/bin/javac" 1 Now run: $ sudo update-alternatives -install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-9.0.4/bin/java" 1 Now move the JDK 8 directory to /usr/lib $ sudo mkdir -p /usr/lib/jvm N.B.: Check carefully this folder name since Oracle seem to change this occasionally with each update. Uncompress it: $ tar -xvf jdk-9.0.4_linux-圆4_bin.tar Download the 64-bit (or 32-bit) Linux “compressed binary file” into your home directory – it has a “.tar.gz” file extension.
