Java is one of the most popular languages today, and it is almost a necessity for any programmer since it is used everywhere on the Internet. And to stay updated with the web technologies, we will also need to get the latest version of Java in our system.
Java是当今最流行的语言之一,几乎所有的程序员都必须使用Java,因为它在Internet上无处不在。 为了与Web技术保持同步,我们还需要在系统中获取Java的最新版本。
In this tutorial, we will look at how we can install Oracle’s latest edition of Java in our Ubuntu 18.04 System.
在本教程中,我们将研究如何在Ubuntu 18.04系统中安装Oracle最新版本的Java。
步骤1:更新系统套件 (Step 1: Update System Packages)
We first need to install the Java Development Kit (JDK) on our system. By installing this, we are also installing the Java Runtime Environment (JRE), which is necessary for compiling and executing any Java program.
首先,我们需要在系统上安装Java开发工具包 ( JDK )。 通过安装它,我们还将安装Java Runtime Environment ( JRE ),这对于编译和执行任何Java程序都是必需的。
Just to ensure that we do not have Java already on our system, type:
为了确保我们的系统上没有Java,请输入:
java --version
You’ll get an output similar to the below screenshot, indicating that it is not yet installed in the system.
您将获得类似于以下屏幕截图的输出,表明该输出尚未安装在系统中。
There is a JDK version available from the apt
package manager, but it is of a slightly older version, so let’s use Oracle’s website directly to fetch Oracle’s latest JDK. As of the time of writing, the latest version is JDK 13.0.1.
apt
软件包管理器提供了一个JDK版本,但是它是一个稍旧的版本,因此让我们直接使用Oracle网站来获取Oracle最新的JDK。 在撰写本文时,最新版本是JDK 13.0.1 。
NOTE: We need to download JDK manual