Oracle java 7 Installation in Ubuntu E: Sub-process /usr/bin/dpkg returned an error code (1)

后端 未结 6 1004
我寻月下人不归
我寻月下人不归 2020-12-30 15:16

I can\'t install oracle java 7 following the steps provided in this link: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

sudo ad         


        
相关标签:
6条回答
  • 2020-12-30 15:40

    sudo dpkg -P oracle-java7-installer

    sudo apt-get -f install

    0 讨论(0)
  • 2020-12-30 15:49
    1. install synaptic if do not install before than.
    2. open synaptic package manager.
    3. search jdk.
    4. mark for removal all jdk installed package .
    5. apply to remove.
    6. mark for installation openjdk-8-jdk.
    7. apply.
    8. N-joy.

    0 讨论(0)
  • 2020-12-30 15:50

    Please follow below steps to install oracle java:

    Download the latest Java SE SDK version.

    http://www.oracle.com/technetwork/java/javase/downloads/index.html

    Untar the Archive:

    tar -xzvf jdk-8-linux-x64.tar.gz
    mv jdk1.8.0 /opt 
    cd /opt/jdk1.8.0
    

    This step registers the downloaded version of Java as an alternative, and switches it to be used as the default:

    update-alternatives --install /usr/bin/java java /opt/jdk1.8.0/bin/java 1
    update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0/bin/javac 1
    update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.8.0/jre/lib/amd64/libnpjp2.so 1
    update-alternatives --set java /opt/jdk1.8.0/bin/java
    update-alternatives --set javac /opt/jdk1.8.0/bin/javac
    update-alternatives --set mozilla-javaplugin.so /opt/jdk1.8.0/jre/lib/amd64/libnpjp2.so
    

    Test

    To check the version of Java you are now running

    java -version
    

    Output

    java version "1.8.0"
    Java(TM) SE Runtime Environment (build 1.8.0-b132)
    Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
    

    To check the browser plugin browse to http://www.java.com/ and click “Do I have Java?”

    Ref: https://askubuntu.com/questions/437776/ubuntu-13-04-unable-to-install-jdk7

    0 讨论(0)
  • 2020-12-30 15:56

    The reason is : WHY ORACLE JAVA 7 AND 6 INSTALLERS NO LONGER WORK

    If you have an Oracle Support account and you really need Oracle JDK 6 or 7, you can get the installers from the WebUpd8 PPA to work by downloading the binaries and placing them in the following folder:

    • /var/cache/oracle-jdk6-installer/ for JDK 6 (you'll need version 6u45)
    • /var/cache/oracle-jdk7-installer/ for JDK 7 (you'll need version 7u80 for 32bit and 64bit or 7u60 for arm)

    ... and then install the oracle-java6-installer or oracle-java7-installer package.

    0 讨论(0)
  • 2020-12-30 15:58

    i think that your download is corrupted you have to remove the corrupted package first by code :

    sudo apt-get purge oracle-java7-installer
    

    clean your apt :

    sudo apt clean
    

    remove and reimport the ropsitory:

    sudo add-apt-repository --remove ppa:webupd8team/java
    sudo apt-get update
    sudo apt-add-repository ppa:webupd8team/java
    sudo apt-get update
    

    install your package again :

    sudo apt-get install oracle-java7-installer
    

    enjoy it bro ! if the problem hasn't solved try using VPN . Maybe there is a filtering between you and the oracle website

    0 讨论(0)
  • 2020-12-30 16:02

    Tried with the solution but still not working. Even when I tried to download the jdk tar from the Oracle site it still failed at around 30-50MB. Anyway I found an article which talks about it and finally got it fixed!

    Oracle Adds License to oracle-java7-installer and Now It Fails (published on March 2014)

    Basically the steps are similar except the last one:

    sudo apt-get update
    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java8-installer
    
    0 讨论(0)
提交回复
热议问题