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) **".
We have confirmed the operation in the following environment.
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)
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
If you want to install a version that is not in ʻapt`, please follow the steps on the official OpenJDK website below.
Recommended Posts