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:
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:
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:
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: