gpt4 book ai didi

java - 使用 java-1.8.0-amazon-corretto 时缺少 jdk

转载 作者:行者123 更新时间:2023-12-03 07:27:45 28 4
gpt4 key购买 nike

我有这个错误:

Could not find tools.jar. Please check that /usr/lib/jvm/java-1.8.0-amazon-corretto.x86_64/jre contains a valid JDK installation.

在cloudformation模板中,我有:

        extras:
commands:
'a_enable_docker':
command: 'amazon-linux-extras enable docker=18.06.1'
test: "! grep -Fxq '[amzn2extra-docker]' /etc/yum.repos.d/amzn2-extras.repo"
'b_enable_corretto8':
command: 'amazon-linux-extras enable corretto8'
test: "! grep -Fxq '[amzn2extra-corretto8]' /etc/yum.repos.d/amzn2-extras.repo"
install:
packages:
rpm:
jenkins: 'https://pkg.jenkins.io/redhat-stable/jenkins-2.176.3-1.1.noarch.rpm'
yum:
'java-1.8.0-amazon-corretto': []
'ruby': []

https://github.com/widdix/aws-cf-templates/blob/master/jenkins/jenkins2-ha-agents.yaml#L1734-L1737

这样,java就安装好了,

[root@ip-10-1-15-79 ~]# java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment Corretto-8.222.10.2 (build 1.8.0_222-b10)
OpenJDK 64-Bit Server VM Corretto-8.222.10.2 (build 25.222-b10, mixed mode)
[root@ip-10-1-15-79 ~]# yum info java-1.8.0-amazon-corretto-devel
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Available Packages
Name : java-1.8.0-amazon-corretto-devel
Arch : x86_64
Epoch : 1
Version : 1.8.0_222.b10
Release : 2.amzn2
Size : 64 M
Repo : amzn2extra-corretto8/2/x86_64
Summary : Amazon Corretto development environment
URL : https://github.com/corretto/corretto-8
Licence : ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib.
Description : Amazon Corretto's packaging of the OpenJDK 8 code.

但是如何添加jdk?

非常感谢任何建议

最佳答案

您需要使用java-1.8.0-amazon-corretto-devel来获取JDK,如果没有尾随devel,它只是一个JRE

关于java - 使用 java-1.8.0-amazon-corretto 时缺少 jdk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57893905/

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