【问题标题】:How to install oracle-java8-installer after the new update新更新后如何安装 oracle-java8-installer
【发布时间】:2019-05-02 05:42:22
【问题描述】:

在 oracle java8 中进行新更新后,我无法在我的 ubuntu 系统上安装 java。它显示了这个错误

E: Package 'oracle-java8-installer' has no installation candidate
ERROR: Service 'app' failed to build: 
The command '/bin/sh -c echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections &&   add-apt-repository -y ppa:webupd8team/java &&   apt-get update &&   apt-get install -y oracle-java8-installer &&   rm -rf /var/lib/apt/lists/* &&   rm -rf /var/cache/oracle-jdk8-installer' returned a non-zero code: 100

我正在尝试将它安装在我的Docker 系统中。

我尝试过到处搜索,但在任何地方都找不到任何答案。所有答案都已过时。

【问题讨论】:

  • 你为什么不使用openjdk:8-jre-alpine。它适用于基于 Oracle JDK 的应用程序吗?
  • 添加你的 Dockerfile。什么是基础镜像?
  • ubuntu:xenial 是我的基础镜像

标签: java docker ubuntu


【解决方案1】:

oracle JAVA(JDK)8 Install PPA 停产后,我遇到了与 ubuntu:bionic 基本映像相同的问题,因此我安装了 amazon Correcto openjdk8。

这是我的 dockerfile 中的有效 java RUN 命令

RUN wget https://d3pxv6yz143wms.cloudfront.net/8.212.04.2/java-1.8.0-amazon-corretto-jdk_8.212.04-2_amd64.deb && \
    apt-get update &&  apt-get install java-common && apt-get install -y --no-install-recommends apt-utils && \
    dpkg --install java-1.8.0-amazon-corretto-jdk_8.212.04-2_amd64.deb

参考:https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/generic-linux-install.html

【讨论】:

  • 我觉得这不是解决这个问题的正确方法
  • @HarshitKhetan 亚马逊 Correcto opendjk 确实适用于我自定义的 docker 映像。
  • 高山图像的任何解决方案?
  • @HarshitKhetan ,我推荐这个网站在 alpine 映像中安装 java 它对我有用,希望这对你也有用参考:wittchen.io/2017/12/27/…
  • 这对生产不好,8u202是最后一个免费用于生产的版本,之后8u211,8u212只能用于生产,需要付费
猜你喜欢
  • 2018-06-26
  • 1970-01-01
  • 2019-09-17
  • 2020-07-17
  • 2019-10-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多