Installing Java 7 on Debian Squeeze

For all of my servers I use Debian, however that distribution has a few problems, mainly the packages can be a bit behind the cutting edge.

Now this is usually a good thing if you are looking for stability – cutting edge software can have issues, especially from new features etc, so for a live environment you want something thats stable.

However, there does come a time when this can bite back. You either need a feature thats not in the standard repositories or in this case the version is now unsupported.

In Debian Squeeze it has Java 6 – but that was EOL’d a couple of months ago so is no longer supported by Oracle. The current version is Java 7 update 17.

So how do we get Java 7 installed?

Well it’s pretty easy to do, we just need to add another repository into apt and install it.

First the repository:

sudo su -
echo "deb precise main" | tee -a /etc/apt/sources.list
echo "deb-src precise main" | tee -a /etc/apt/sources.list
apt-key adv --keyserver --recv-keys EEA14886
apt-get update

What that does is to install the ubuntu ppa repository into apt, setup the public keys and then load the package lists.

Next we need to install it:

sudo apt-get install oracle-java7-installer

This will now download Oracle Java 7 and present you with a couple of screens about licensing. Just ok and accept it and it will now install.

That’s it. You now have Java 7 installed – but it’s not the default JDK (if you already had Java 6 installed). If you want it to be the default then there’s just one more thing to do:

sudo apt-get install oracle-java7-set-default

That’s a dummy package but it will make Java 7 the default on that machine. If you want to check then you can check:

peter@titan ~ $ java -version
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

Kenai – is it closing or is it staying?

Well this is a bit of a shock – first they were going to close so a lot of projects (including myself) started migrating away as we had a deadline of 20th April but a couple of hours ago I got an email saying everything’s changed. Now it appears that they are going to migrate to the kenai architecture so all projects are going to be migrated there rather than just deleted.

Now they could have told us this in the first place and have saved a lot of us the now wasted time of migrating everything away from kenai – effectively 1 1/2 weeks wasted in ensuring nothing is lost.

It’s not all wasted effort however.

As I use a distributed scm (Mercurial) I’ve now got a working online backup of the sources over at – thats working fine, so if this is true then that will stay. I have an offline backup of the repos which I automatically push to anyhow, so getting that job to push back out to bitbucket is easy. As a bonus you can even see commits on twitter.

Also the maven repositories are at sonatype – so there maven is now working better than it did at kenai (one of the only two things I had problems with on kenai).

The one big problem I had in migrating was the project. I had created two projects on as that appeared to have something closer to kenai (other than jira). However I soon found two major downsides to it.

  1. You must have a javaforge account to clone from mercurial – you can’t even browse source unless logged in
  2. Anyone who submits a changeset must also have a javaforge account

Now these problems are terrible. It effectively locks you in to them and removes the benefits of having a distributed scm – receive a changeset from someone and push it to there – they automatically refuse the changeset. Also why prevent someone access to the source if they are anonymous? I’ve since found references to that problem where people have given up on javaforge because you can’t to it. Not good.

So what now?

Well I’m going to plod on – I’ve got a few major issues to sort out with JAXB and XMPP to deal with, so I’m going to see what is said over the weekend after the surprise announcement. If this is true then I’m going to stay with kenai/ – lets hope this means keeping jira! As others have said in the forums, kenai is the best forge out there and the only one with true IDE support with NetBeans’s kenai module.

I’ll finish off (it’s 3:30 in the morning right now) with the email about this change of heart from Oracle:


In an effort to get information out to the Kenai community quickly, while trying to manage the integration of our two companies, I think we did a poor job at communicating our plans for to you. I would like to remedy that now. Our strategy is simple. We don’t believe it makes sense to continue investing in multiple hosted development sites that are basically doing the same thing. Our plan is to shut down and focus our efforts on as the hosted development community. We are in the process of migrating to the kenai technology. This means that any project currently hosted on will be able to continue as you are on We are still working out the technical details, but the goal is to make this migration as seamless as possible for the current projects. So in the meantime I suggest that you stay put on and let us work through the details and get back to you later this month.

Thanks for your feedback and patience.

Ted Farrell
Oracle Corporation

%d bloggers like this: