首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在使用java-1.8.0-amazon-corretto时缺少jdk

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

Stack Overflow用户
提问于 2019-09-11 17:11:50
回答 1查看 1.3K关注 0票数 1

我有一个错误:

代码语言:javascript
复制
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模板中,我有:

代码语言:javascript
复制
        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,

代码语言:javascript
复制
[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呢?

任何建议都是非常感谢的

EN

回答 1

Stack Overflow用户

发布于 2022-09-14 01:17:13

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57893905

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档