Install OpenJDK (Java) on the latest Ubuntu

Java installation

For Ubuntu, you can install it with the ʻapt` command. If you just want to run Java, read the chapter "** Java users only (JRE) ", and developers should read the chapter " Developers (JDK) **".

environment

We have confirmed the operation in the following environment.

Java users only (JRE)

Search for OpenJDK version

terminal


$ sudo apt search openjdk-\(\.\)\+-jre$

Install any version. Java 8 is selected here.

terminal


$ sudo apt-get install openjdk-8-jre

Finally, make sure Java is installed.

terminal


#java version check
$ java -version
openjdk version "1.8.0_162"
OpenJDK Runtime Environment (build 1.8.0_162-8u162-b12-1-b12)
OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode)

Developer (JDK)

Search for developer versions of OpenJDK

terminal


$ sudo apt search openjdk-\(\.\)\+-jdk$

Install any version. Java 8 is selected here.

terminal


$ sudo apt install openjdk-8-jdk

Make sure it was last installed. If you have installed the JDK, you will be able to use the javac command.

terminal


#java version check
$ java -version
openjdk version "1.8.0_162"
OpenJDK Runtime Environment (build 1.8.0_162-8u162-b12-1-b12)
OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode)

#Check if the JDK is installed
$ javac -version
javac 1.8.0_162

Finally

If you want to install a version that is not in ʻapt`, please follow the steps on the official OpenJDK website below.

Recommended Posts

Install OpenJDK (Java) on the latest Ubuntu
Install Java on WSL Ubuntu 18.04
Install the latest version of Jenkins on Ubuntu 16
Build the latest Samba 4 on Ubuntu 20.04
Install OpenJDK (Java) on the latest Ubuntu
Install OpenJDK on macOS
Install Java on Mac
Install pyqt5 on ubuntu
Install Ruby on Ubuntu 20.04
Install Autoware on Ubuntu 18.04.5
Install openjdk11 on mac
Install Homebrew on Ubuntu 20.04
Install OpenJDK 8 on mac
Install Java 11 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Install Java 14 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Install Java 8 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Install Docker on Ubuntu Server 20.04
Oracle Java 8 on Docker Ubuntu
Install zabbix agent (5.0) on Ubuntu 18.04
Install MAV Proxy on Ubuntu 18.04
Install Java 8 (OpenJDK: Amazon Corretto) on macOS with Homebrew
Install the latest hardware drivers from ELRepo on CentOS
Install Arudino IDE on Ubuntu 20
Install Ubuntu Desktop 20.10 on RaspberryPi4
Install Arduino IDE on Ubuntu 20.04
Run java applet on ubuntu
Install Java 8 (OpenJDK: Zulu Community) on macOS with Homebrew
Install raspi-config on Ubuntu 20.04 (LTS)
Install WordPress 5.5 on Ubuntu 20.04 LTS
Install PlantUML on Intellij on Ubuntu
Install Ubuntu Server 20.04 on Btrfs
Note: Install PostgreSQL 9.5 on Ubuntu 18.04
Install ag (the silver searcher) [on CentOS / Ubuntu / Mac]
Install java 1.8.0 on Amazon linux2
Install docker and docker-compose on ubuntu in the shortest process
How to install java9 on elementaryOS Freya or Ubuntu 14.04 LTS
How to switch Java in the OpenJDK era on Mac
[Java development environment construction] Install OpenJDK 11 (Java 11) on macOS with Homebrew.
Install java with Ubuntu 16.04 based Docker
Install AWS IoT Greengrass on Ubuntu
Install JDK and JRE on Ubuntu 16.10
Install ngrok on ubuntu16.04 using Vagrant
Install Java Open JDK 8 on CentOS 7
Consideration on the 2017 Java Persistence Framework (1)
How to install WildFly on Ubuntu 18.04
Install MQTT broker Mosquitto on Ubuntu 18.04
Enable Java 8 and Java 11 SDKs on Ubuntu
Install SonarQube on ECS instance on Ubuntu 16.04
Java cannot be installed on Ubuntu 13.04
Install ruby on Ubuntu 20.04 with rbenv
Install Java 9 on windows 10 and CentOS 7
Install Java development environment on Mac
Install the memcached plugin on MySQL and access it from Java
How to install and configure the monitoring tool "Graphite" on Ubuntu
How to install Adopt OpenJDK on Debian, Ubuntu with apt (-get)
Install Ubuntu20.04 on RaspberryPi 4 and build Kubernetes to run the container
If you can't install java on Catalina
Kick ShellScript on the server from Java
How to install production Metabase on Ubuntu
I want to install PHP 7.2 on Ubuntu 20.04.
Install the webmail client Rainloop on CentOS 8