Linux Question

Posted on 2014-07-13
Last Modified: 2014-07-27
I am trying to download the JDK6 package from a URL and install it using the command line.  I am using wget, it find the url but how do I get it to download the correct package?

Here is the site I am trying to get the installation file from:
Question by:Jack_son_
    LVL 14

    Assisted Solution

    You can't use wget. Oracle hides the download behind a Javascript link because that forces you to accept the license agreement before it can be downloaded.

    If you're trying to automate an installation process, you'll have to download the JDK manually first, then launch it within your script from a local drive, ftp server, or file server.
    LVL 87

    Assisted Solution

    Why even download it from Oracle's site? Most distributions include it in their repositories and you'd only have to install it directly via your distro's package manager.
    LVL 14

    Assisted Solution

    @rindi, a download would be needed if the OP needs a newer (or older) JDK than his distro provides.
    LVL 87

    Expert Comment

    But you risk making your system unstable by installing software that isn't supported. Not using your repository to install software should only ever be your very last resort.
    LVL 20

    Assisted Solution

    @rindi: Oracle supply rpms for Linux; I agree that the Linux distros updates should be the "best" version if they're updated in a timely fashion, but I've found subtle differences between the SUSE/IBM release of Oracles latest fix, and Oracles own rpm.

    @Jack_son_: From an answer I posted at :

    Oracle provide persistent links to the latest updates of each Java version as documented at - though you need to create/log in to an Oracle Support account. *Otherwise you can only access the last "public" update of each Java version, e.g. 1.6_u45 (Mar 2013; Latest update is u65, Oct 2013)*

    Once you know the persistent link, you should be able to resolve it to the real download; The following works for me, though I don't yet know if the "aru" reference changes.


    echo "Get real URL from the persistent link"

    wget -o getrealurl.out --no-cookies --no-check-certificate --user=$ME \
    --password=$PW --header "Cookie:" \$PATCH_FILE?aru=16884382&\

    wait    # wget appears to go into background, so "wait" waits
            # until all background processes complete

    REALURL=`grep "^--" getrealurl.out |tail -1 |sed -e 's/.*http/http/'`
    #These last steps must be done quickly, as the REALURL seems to have a short-lived
    #cookie on it and I've had no success with  --keep-session-cookies etc.
    LVL 34

    Assisted Solution

    by:Seth Simmons
    if you are using a linux system with a gui, download through the browser there and install else download on a windows system and transfer the file through filezilla
    simpler than trying to get wget to work with oracle sso sessions which may not be possible
    LVL 61

    Accepted Solution

    I assume your distribution comes with supported version of OpenJDK
    For JDK 6 oracle offers only old and insecure version, which you nest avoid.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. Once you open the link you will see …
    I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension ( This reminded me of questions tha…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now