apt-get installing oracle java 7 stopped working

前端 未结 5 1057
执念已碎
执念已碎 2021-02-01 07:07

Recently apt-get install -y oracle-java7-installer stopped working.

I know in their roadmap, I think the public version is no longer supported, but it\'s be

5条回答
  •  余生分开走
    2021-02-01 07:50

    It appears Oracle has moved the download link, you can still fetch the tar ball from the oracle website after jumping through some hoops. The WebUpd8 installer is currently broken. The official explanation can be found at http://www.webupd8.org/2017/06/why-oracle-java-7-and-6-installers-no.html


    Download Method 1: Login into to Oracle site

    The link now seems to be: http://download.oracle.com/otn/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz notice "otn" and not "otn-pub", but at least from the website you seem to need to be signed in and not only accept the license agreement.

    It may be possible with debconf to change the url from otn-pub to otn and get the installer to work but I haven't tried. You can fetch the binary yourself and either install manually or with the installer pointing it to wherever you put the downloaded tar ball.

    Edit: It seems there isn't a way to configure download URL (though you can hijack it with hosts as in another answer).

    Download Method 2: Use a trusted mirror

    If you want to download jdk-7u80-linux-x64.tar.gz from a script without logging into to oracle it hosted locations include:

    • http://ftp.osuosl.org/pub/funtoo/distfiles/oracle-java/
    • http://ftp.heanet.ie/mirrors/funtoo/distfiles/oracle-java/

    EDIT: The sha256 has been removed from this answer because (as this edit demonstrates) anyone can edit said hash. Get your hashes from a trusted source. Suggestions include:

    • https://www.oracle.com/webfolder/s/digest/7u80checksum.html

    Install Method 1: Prepopulate cache

    #put the file in the default cache location:
    sudo mv jdk-7u80-linux-x64.tar.gz /var/cache/oracle-jdk7-installer/
    
    #then install normally: 
    sudo apt-get install oracle-java7-installer
    

    Install Method 2: (more elegant IMHO) put tar ball anywhere and tell the installer where to look

    #setup ppa (you probably came here after already doing this)
    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    
    #put the file in a temporary location:
    sudo mv jdk-7u80-linux-x64.tar.gz /tmp/
    
    
    #set local path to /tmp (or any other path)
    echo oracle-java7-installer oracle-java7-installer/local select /tmp | \
    sudo /usr/bin/debconf-set-selections
    
    
    #While your at it you may want tp approve license (or skip this and approve when prompted) 
    echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | \
    sudo /usr/bin/debconf-set-selections
    
    #then install normally: 
    sudo apt-get install oracle-java7-installer
    

提交回复
热议问题