Life Codecs @ NamingCrisis.net

Ruminations. Reflections. Refractions. Code.

Dec 9, 2012 - how to software dev

Oracle JDK on Debian

Just came across JavaPackage in Debian. This allows you to cleanly replace OpenJDK with a complying alternative systemwide, the Debian Way. I was only interested in the Oracle JDK, and that worked a treat, not sure about other JDKs. In essence:

  1. Install the JavaPackage package using apt[itude]
  2. Download the .tar.gz JDK package from Oracle
  3. Run make-jpkg, installed as part of JavaPackage, against it (not as root); this produces a Debian package of the tarball
  4. Install the Debian package using dpkg
  5. Finally, use update-java-alternatives to update various Java-related symlinks systemwide. You can choose to only update a subset (e.g. just use the Oracle JDK for the browser plugins, but nothing else), or go the whole hog — all JDK binaries will then be from the Oracle JDK.

The wiki link has examples and details.

PS. I really miss saying “Sun JDK”.