I'm trying to get JDK 1.6 using the following command:

wget 'http://download.oracle.com/otn/java/jdk/6u14-b08/jdk-6u14-linux-x64.bin'

The download fails and I suspect it's related to the fact that the website requires you to accept the license agreement. Is there a way to accept the agreement and receive the file?

  • 1
    I assume that you are tying to install the oracle version of Java instead of the IcedTea JDK version that the software center installs? if so I can post an easier way to do that..... – TrailRider Jul 31 '12 at 3:12
  • The assumption is correct... – KalenGi Jul 31 '12 at 4:49

I will go ahead and post it just in case....Please note however that these instruciton install Java7 NOT Java6

cut and paste from http://www.webupd8.org

Install Oracle Java 7

For most stuff, OpenJDK/JRE is enough (and you can install it using Ubuntu Software Center), but in case you really need Oracle (previously Sun) Java 7, you can install it (this will install JDK/JRE and the browser plugin) in Ubuntu using the WebUpd8 Java PPA

in terminal type

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

This is a excerpt of my answer to this question.

The PPA that you install with thesecommands only points to the Java website to make installing easier, it does not contain Java itself. Oracle changed the license and now it can not be hosted anywhere and can only be downloaded directly from Oracle..

HERE is an older post from the same site that gives more information on this change as well as more information on Java7 itself and how to remove it , check for and select which version is running.

  • I like this approach where there's no need for a browser. Is there a way to do this for an RPM? – KalenGi Jul 31 '12 at 4:48
  • Sorry, ignore the RPM question. Just discovered that nowadays the JDK is already compiled so it just requires extraction. – KalenGi Jul 31 '12 at 4:55
  • I had luck getting 1.6 using sudo apt-get install oracle-java6-installer. This worked even when the Oracle JDK archive site was giving me 404s or 410s. – eebbesen Nov 20 '13 at 16:15

If you accept the agreement once you can then use the --load-cookies FILE option to wget to get it to use the saved cookie (e.g. from your .mozilla folder) to do the download. I don't see another way of doing it.


  1. Accept the agreement in Firefox
  2. Use wget --load-cookies ~/.mozilla/firefox/XXXX.default/cookies.txt URL


Only works with old firefox cookies store - not the new sqlite backend.


Alternatively you can install the Sun JDK from the repos as TrailRider hinted at - the license agreement is done during the install.

  • "from the repos as TrailRider hinted at" I did not post it as it was not really an answer to the question that was asked, I posted it anyway it can get downvoted if someone wants to nitpick I guess. – TrailRider Jul 31 '12 at 4:24
  • @TrailRider: I agree - I mentioned it as an alternative because using wget may not be possible anyway. The OP seems to be happy with using repos anyway. – jmetz Jul 31 '12 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.