Custom Search

Saturday, March 10, 2018

How to install Oracle Java JDK 9 in Ubuntu 18.04

0)
Download jdk9

http://www.oracle.com/technetwork/java/javase/downloads/index.html

http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html

1)
java –version

2)
sudo mkdir -p /usr/lib/jvm/jdk9

3)
sudo mv jdk*/* /usr/lib/jvm/jdk9

4)
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk9/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk9/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk9/bin/javaws" 1

5)
java –version
javac –version

6)
sudo vim /etc/environment
JAVA_HOME="/usr/lib/jvm/jdk9"

7)
source /etc/environment

8)
echo $JAVA_HOME

9)
java –version
javac –version


No comments:

Post a Comment