0% found this document useful (0 votes)
24 views

Manually Install Oracle Java JDK On Ubuntu 16.04: /etc/profile.d/jdk - SH

This document provides instructions to install Oracle Java 8 and 9 on Ubuntu 16.04 using both the apt package manager and manually downloading and extracting the Java archive. The steps using apt add the WebUpd8 PPA repository, update packages, and install java8-installer and java9-installer. The manual steps download the Java 8 archive, extract it, move it to the JVM directory, and configure update-alternatives to set Java 8 as the default version.

Uploaded by

inghvd2016
Copyright
© © All Rights Reserved
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Manually Install Oracle Java JDK On Ubuntu 16.04: /etc/profile.d/jdk - SH

This document provides instructions to install Oracle Java 8 and 9 on Ubuntu 16.04 using both the apt package manager and manually downloading and extracting the Java archive. The steps using apt add the WebUpd8 PPA repository, update packages, and install java8-installer and java9-installer. The manual steps download the Java 8 archive, extract it, move it to the JVM directory, and configure update-alternatives to set Java 8 as the default version.

Uploaded by

inghvd2016
Copyright
© © All Rights Reserved
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 1

sudo apt-get install software-properties-common

sudo apt-add-repository ppa:webupd8team/java


sudo apt-get update

sudo apt install oracle-java8-installer

sudo apt install oracle-java9-installer

Manually install Oracle Java JDK on Ubuntu 16.04


cd /tmp
wget --continue --no-check-certificate --header "Cookie: oraclelicense=a"
'http://download.oracle.com/otn-pub/java/jdk/8u121-
b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz'

tar -xf jdk-8u121-linux-x64.tar.gz

sudo mkdir -p /usr/lib/jvm


sudo mv jdk1.8* /usr/lib/jvm/java-8-oracle

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-8-


oracle/jre/bin/java 1091
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-8-
oracle/bin/javac 1091

/etc/profile.d/jdk.sh

sudo source /etc/profile.d/jdk.sh

java -version

You might also like