0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

How to Install Oracle JDK 1.8 in Ubuntu 18.04 LTS?

Posted at

1. Download JDK 1.8.172

2. Unzip

# sudo mv ~/Download/jdk-8u172-linux-x64.tar.gz /opt
# cd /opt
# sudo tar zxvf jdk-8u172-linux-x64.tar.gz
# sudo chown -R root:root jdk1.8.0_172/
# sudo ln -s jdk1.8.0_172/ jdk

3. Set Env

# sudo vim /etc/profile.d/java-sdk-env.sh

export JAVA_HOME=/opt/jdk
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin

:wq!

4. Reboot

# sudo reboot

5. Check

# java -version

java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?