使用yum命令在centos上安装open jdk 11 [英] Installing open jdk 11 on centos using yum commands

查看:124
本文介绍了使用yum命令在centos上安装open jdk 11的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 yum 命令安装 open jdk 11.但是,当我查看 open jdk 手册时,它说 jdk 版本 1.8 之前您可以使用 yum 命令.如何使用 9 on wards 您必须下载 zip 或 tar 文件.(https://openjdk.java.net/install/)

I want to install open jdk 11 using yum command . however when i check the open jdk manual , it says up to jdk version 1.8 you can use yum command . how ever with 9 on wards you have to download zip or tar file . (https://openjdk.java.net/install/)

我们没有提供 yum 命令的任何原因.我是 linux 的新手.感谢任何帮助

any reason why we are not provided with a yum command. I am bit newbie to linux. appreciate any help

推荐答案

原因,简而言之,是因为必须有人维护包并将它们放入您的系统正在使用的存储库中,并验证它们运行稳定.例如,Debian 上的 OpenJDK 11 仍处于 buster (testing) 和 sid (unstable) 中,因此在任何 stable 分支中都不可用.我想在 CentOS 中(我对它不太熟悉 tbh.)情况相同.

The reason, in short, is because someone has to maintain the packages and put these into the repositories your system is using and verify, that they run stable. For example, the OpenJDK 11 on Debian is still in buster (testing) and sid (unstable) and therefore not available in any stable branch. I guess in CentOS (I am not that familiar with it tbh.) it's the same situation.

迟早你将不得不在任何操作系统中安装没有管理器的软件,所以即使你说你是一个菜鸟,你迟早必须学会这一点.如果您现在想使用 openjdk11,则必须使用非官方存储库或手动安装软件,我建议这样做.

Sooner or later you'll have to install software without a manager in any OS, so even if you're saying you're a noob, you'll have to learn that sooner or later. And if you want to use openjdk11 now, you'll have to use either an unofficial repository or install the software by hand, what I'd recommend.

然而,这里有一个指南,它是 openjdk11 centos 在 Google 上的第二次点击:

However, here is a guide which is the second hit on Google for openjdk11 centos:

curl -O https://download.java.net/java/GA/jdk11/13/GPL/openjdk-11.0.1_linux-x64_bin.tar.gz
tar zxvf openjdk-11.0.1_linux-x64_bin.tar.gz
mv jdk-11.0.1 /usr/local/

vi /etc/profile.d/jdk11.sh

# create new
export JAVA_HOME=/usr/local/jdk-11.0.1
export PATH=$PATH:$JAVA_HOME/bin

source /etc/profile.d/jdk11.sh

java -version

openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)

来源:https://www.server-world.info/en/note?os=CentOS_7&p=jdk11&f=2

这篇关于使用yum命令在centos上安装open jdk 11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆