我有一个错误:
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呢?
任何建议都是非常感谢的
发布于 2022-09-14 01:17:13
您需要使用java-1.8.0-amazon-corretto-devel来获得JDK,没有那个尾随的devel,它只是一个JRE
https://stackoverflow.com/questions/57893905
复制相似问题