Lets be honest, coding on Linux will probably include some Java based application like Eclipse or NetBeans. That's actually not a bad thing because we get to carry our development environment with us when using other proprietary operating systems. But since Oracle sliced "Operating System Distributor License for Java" and now nobody can legally host Java repository we have to install Java manually by downloading their JRE or JDK blob from Oracle servers. That isn't exactly hard thing to do but we don't want to give Oracle the pleasure of knowing that they made our already crowded day a little more complicated. So here I'm presenting work of excellent Debian packaging work by Janusz Dziemidowicz and a fellow open source enthusiast Martin Wimpress from Flexion.Org. These guys made it possible for us to create Java JDK 6 and JRE 6 deb packages and create local Java repository our selves.
If BASH script described in this article fails this means that script developer has failed to update script for latest Oracle web site changes. You can create latest Sun Java JDK and JRE 6 packages manually using instructions from my later article.
All we need to do is to download and execute Martin Wimpress BASH script, and that script will use Janusz Dziemidowicz work to create local repository and Java JDK deb packages. Now make yourselves a coffee, open your terminal and paste these commands:
cd ~/ wget https://raw.github.com/flexiondotorg/oab-java6/master/oab-java.sh -O oab-java6.sh chmod +x oab-java6.sh sudo ./oab-java6.sh
Now after you get "All done!" from this BASH script you can use following command to install full Java JDK 6 from your local repository:
sudo apt-get install sun-java6-bin sun-java6-fonts sun-java6-javadb sun-java6-jdk sun-java6-jre sun-java6-plugin sun-java6-source
If Java JRE 6 is all you need (if you don't plan on creating Java based applications on your machine) then you can use following command:
sudo apt-get install sun-java6-jre sun-java6-plugin
To test you new Java installation just take a look at the output of following command:
Just a note, if your NetBeans spits out "Cannot find java. Please use the --jdkhome switch." then you can use one of my older articles to give it a little push:
That's it, big thanks to you Janusz and Martin for making our day little easier.
Thanks been looking for that 😉
Thanks! OpenJDK doesn’t work right for my apps.
You are not checking for accept/decline license therefore .bin files in cache are very likely to only be a HTML errror page instad of actual java install packages.
thnx for help useful script
https://raw.github.com/flexiondotorg/oab-java6/master/oab-java6.sh gives me a 404 error.
Link has changed, thanks for reporting. It’s correct now (oab-java.sh instead of oab-java6.sh):
The script gets a fetch error on http://ppa.launchpad.net/ferramroberto/java/ubuntu/dists/precise/main/binary-i386/Packages
but the apt-get install seems to have succeeded.