在Ubuntu上安装JDK8时出错

时间:2018-07-18 09:28:37

标签: java-8

HTTP请求已发送,正在等待响应...找不到404 2018-07-18 14:49:48错误404:找不到。

下载失败 未安装Oracle JDK 8。 dpkg:错误处理软件包oracle-java8-installer(--configure):  子进程已安装的安装后脚本返回错误退出状态1 处理时遇到错误:  oracle-java8-安装程序 E:子进程/ usr / bin / dpkg返回错误代码(1)

我无法以任何方式安装jdk,plz会如何答复..如果any1理解了我为它找到的错误,但显示的补救措施没有用,它会反复给我同样的错误

2 个答案:

答案 0 :(得分:0)

@jasmin,现在已安装,我的项目的travis版本也出现了错误。但是现在安装了它。请参考以下线程:https://github.com/travis-ci/travis-ci/issues/9512。四月份也花了一天的时间使事情再次运行,而无需用户更改任何内容。

答案 1 :(得分:0)

我这样解决了。

修复Ansible剧本:

- name: ORACLE JAVA | Install oracle java from ppa repository  
  apt:
    pkg: "{{ item }}"
    update_cache: yes
    state: latest
    force: yes
  become: true
  become_user: root
  with_items:
    - "oracle-java{{ java_version }}-installer"
    - "oracle-java{{ java_version }}-set-default"
  ignore_errors: yes


- name: ORACLE JAVA | Fix oracle java
  shell: "{{ item }}"
  with_items:
    - cd /var/lib/dpkg/info && sed -i 's|JAVA_VERSION=8u171|JAVA_VERSION=8u181|' oracle-java8-installer.*
    - cd /var/lib/dpkg/info && sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/|' oracle-java8-installer.*
    - cd /var/lib/dpkg/info && sed -i 's|SHA256SUM_TGZ=.*|SHA256SUM_TGZ="1845567095bfbfebd42ed0d09397939796d05456290fb20a83c476ba09f991d3"|' oracle-java8-installer.*
    - cd /var/lib/dpkg/info && sed -i 's|J_DIR=jdk1.8.0_171|J_DIR=jdk1.8.0_181|' oracle-java8-installer.*
  become: true
  become_user: root


- name: ORACLE JAVA | Install oracle java from ppa repository
  apt:
    pkg: "{{ item }}"
    update_cache: yes
    state: latest
    force: yes
  become: true
  become_user: root
  with_items:
    - "oracle-java{{ java_version }}-installer"
    - "oracle-java{{ java_version }}-set-default"

修复bash:

apt-get install  oracle-java8-installer oracle-java8-set-default 

cd /var/lib/dpkg/info && sed -i 's|JAVA_VERSION=8u171|JAVA_VERSION=8u181|' oracle-java8-installer.*
sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/|' oracle-java8-installer.*
sed -i 's|SHA256SUM_TGZ=.*|SHA256SUM_TGZ="1845567095bfbfebd42ed0d09397939796d05456290fb20a83c476ba09f991d3"|' oracle-java8-installer.*
sed -i 's|J_DIR=jdk1.8.0_171|J_DIR=jdk1.8.0_181|' oracle-java8-installer.*

apt-get install -y oracle-java8-installer