gpt4 book ai didi

java - 无法使用 wget 在 CentOS 机器上安装 oracle jdk

转载 作者:IT王子 更新时间:2023-10-29 01:07:29 26 4
gpt4 key购买 nike

我想在CentOS上安装oracle java jdk 8我无法安装 java jdk,因为当我尝试使用命令安装 java jdk 时

[root@ADARSH-PROD1 ~]# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u131-b27/jdk-8u131-linux-x64.rpm"

我收到输出:

Connecting to edelivery.oracle.com 
(edelivery.oracle.com)|23.211.196.232|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u131-b27/jdk-8u131- linux-x64.rpm?AuthParam=1495864027_230ebffd10615c26528e8d2496500338 [following]
--2017-05-27 11:15:07-- http://download.oracle.com/otn-pub/java/jdk/8u131- b27/jdk-8u131-linux-x64.rpm? AuthParam=1495864027_230ebffd10615c26528e8d2496500338
Connecting to download.oracle.com (download.oracle.com)|184.25.109.32|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2017-05-27 11:15:09 ERROR 404: Not Found.

最佳答案

2021 年 9 月 17 日更新

Oracle 已决定更改 JDK 许可证。参见 the official blog post .

除此之外,它现在允许从脚本下载 JDK,而无需存储特定的哈希值或接受许可协议(protocol)。还有一个页面“JDK 17 Script Friendly URLs”,其中包含脚本的使用示例。这是该页面的摘录:

For example, to retrieve the current JDK 17 update release for Linux x64 as a compressed (tar.gz) archive, you can use the wget command:

wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz

or with curl:

curl https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz

The checksum for the release can be found by adding .sha256 to the download URL:

https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz.sha256

These URLs will deliver the GA version of JDK 17 and its checksum until the release of the first Critical Patch Update. When 17.0.1 is released the above URLs will deliver 17.0.1 until the release of the 17.0.2 at which point the above URLs will deliver 17.0.2 and so on.

=== 下面是以前版本的答案 ===

Oracle 更新了链接生成机制。它现在包含一些序列,这些序列似乎对某个版本是持久的,但生成时使用的机制未知。此外,要下载除 latest 之外的任何版本,您现在需要拥有 Oracle 帐户:

For production use Oracle recommends downloading the latest JDK andJRE versions and allowing auto-update.

Only developers and Enterprise administrators should download thesereleases.

Downloading these releases requires an oracle.com account. If youdon't have an oracle.com account you can use the links on the top ofthis page to learn more about it and register for one for free.

查看更多信息 Oracle Java Archives页面。

所以你现在有两个选择。

选项 1。通过新的直接链接使用最新版本(8u131)。该链接位于 Java SE Development Kit 8 downloads page。接受许可协议(protocol)后。你的命令将是:

wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm"

选项 2. 切换到 openjdk 包:

yum install java-1.8.0-openjdk

OpenJDK: Download and install 查看更多关于 openjdk 安装的信息页面。

关于java - 无法使用 wget 在 CentOS 机器上安装 oracle jdk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44213454/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com