Java is popular programming language for different platforms and project. Java is actually a programming language standard. Sun provides Java programming language tools under the name of Java Runtime Environment
or JRE
or Java Development Kit
or JDK
. There is alternative name OpenJDK
which is another Java implementation. In this tutorial we will learn how to install OpenJDK.
Java是用于不同平台和项目的流行编程语言。 Java实际上是一种编程语言标准。 Sun以Java Runtime Environment
或JRE
或Java Development Kit
或JDK
的名义提供Java编程语言工具。 还有另一个名称OpenJDK
,它是另一个Java实现。 在本教程中,我们将学习如何安装OpenJDK。
OpenJDK与JDK (OpenJDK vs JDK)
OpenJDK is as its name suggests open source, open innovation and open standards Java framework. OpenJDK is supported by Oracle too bu there is no dictate from Oracle for its direction. OpenJDK provides most of the commercial JDK but there may be some performance problems for minor cases.
OpenJDK顾名思义就是开放源代码,开放创新和开放标准Java框架。 Oracle也支持OpenJDK,但Oracle对此没有明确要求。 OpenJDK提供了大多数商业JDK,但在少数情况下可能会出现一些性能问题。
搜索OpenJDK软件包 (Search OpenJDK Packages)
We will use apt
or apt-cache
search commands to list available OpenJDK packages. We will use headless
search term .
我们将使用apt
或apt-cache
搜索命令列出可用的OpenJDK软件包。 我们将使用headless
搜索词。
$ apt search openjdk headless
As we can see that there is two major versions 8 and 11 provided by out official repositories. There is also JRE and JDK versions too.
如我们所见,官方存储库提供了两个主要版本8和11。 也有JRE和JDK版本。
为Ubuntu,Debian,Mint和Kali安装OpenJDK (Install OpenJDK For Ubuntu, Debian, Mint and Kali)
We will use apt
or apt-get
command for these distributions. There are different versions of OpenJDK which is related with JDK. Lets list them
对于这些发行版,我们将使用apt
或apt-get
命令。 与JDK相关的OpenJDK有不同的版本。 让我们列出他们
$ sudo apt install openjdk-11-jdk-headless -y
为Fedora,CentOS,Red Hat安装OpenJDK (Install OpenJDK For Fedora, CentOS, Red Hat)
We can use yum
or dnf
to get OpenJDK packages. We generally prefer yum
for CentOS and Red Hat dnf
for Fedora.
我们可以使用yum
或dnf
来获取OpenJDK软件包。 对于CentOS,我们通常更喜欢yum
对于Fedora,我们更喜欢Red Hat dnf
。
$ sudo yum install java-openjdk
翻译自: https://www.poftut.com/how-to-install-openjdk-java-programming-framework-to-the-linux/