[JAVA] How to Install Oracle JDK 1.8 in Ubuntu 18.04 LTS?

  1. Download JDK 1.8.172 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

  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
  1. 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

  1. Reboot
# sudo reboot
  1. 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)

Recommended Posts

How to Install Oracle JDK 1.8 in Ubuntu 18.04 LTS?
How to install multiple JDKs on Ubuntu 18.04 LTS
How to install JDK8-10 (Mac)
Install Oracle JDK 8 via PPA in AWS Ubuntu Server 16.04
How to install Swiper in Rails
How to install java9 on elementaryOS Freya or Ubuntu 14.04 LTS
WSL2 + Ubuntu 20.04 Install Vivado in LTS environment
How to install production Metabase on Ubuntu
How to install the language used in Ubuntu and how to build the environment
(Memo) How to solve dummy output in Ubuntu 20.04
How to install network drivers on standalone Ubuntu
How to install Titan2D (v4.2.0) in virtual environment
How to install NVIDIA driver on Ubuntu 18.04 (Note)
How to install Docker
How to install docker-machine
[Java] How to switch from open jdk to oracle jdk
How to install MySQL
[Ruby on Rails] How to install Bootstrap in Rails
How to log in automatically when Ubuntu restarts
How to install ngrok
How to use Oracle JDK 9 EA with Travis CI
Install Oracle JDK 7, 8, etc via Ubuntu installer, skipping interaction
How to install NVIDIA driver on Ubuntu ssh destination
Command memo to install xeyes in ubuntu docker environment
How to change from Oracle Java 8 to Adopt Open JDK 9
How to get jdk etc from oracle with cli
AWS CLI install in Ubuntu 20.04
Install Oracle JDK 8 with Ansible
[Rails] How to install devise
How to install Boots Faces
Install raspi-config on Ubuntu 20.04 (LTS)
Install WordPress 5.5 on Ubuntu 20.04 LTS
[Rails] How to install simple_calendar
[Rails] How to install reCAPTCHA
How to add HDD to Ubuntu
Ubuntu unable to log in
How to use Ubuntu Server 20.10 (Groovy Gorilla) in Sakura's cloud
How to run npm install on all projects in Lerna
How to install JDK 8 on Windows without using the installer
How to dynamically switch JDK when building Java in Gradle
Super easy in 2 steps! How to install devise! !! (rails 5 version)
How to install Web application for each language in Nginx
How to install PHP 7.4 and SQL Server drivers in CentOS 7.7
How to use Lombok in Spring
How to find May'n in XPath
[Rails] How to install Font Awesome
How to hide scrollbars in WebView
How to run JUnit in Eclipse
How to install JMeter for Mac
How to iterate infinitely in Ruby
Install JDK and JRE on Ubuntu 16.10
[Rails] How to write in Japanese
How to master programming in 3 months
How to install ImageMagick on Windows 10
How to install ruby through rbenv
How to get parameters in Spark
Super rough! How to install Dagger2
How to use Bio-Formats on Ubuntu 20.04
How to install MariaDB 10.4 on CentOS 8
How to use InjectorHolder in OpenAM
[Rails] How to install ImageMagick (RMajick)