How can I install a headless JDK on an Ubuntu Jaunty server?

Posted by Hanno Fietz on Server Fault See other posts from Server Fault or by Hanno Fietz
Published on 2009-07-28T13:35:37Z Indexed on 2011/11/11 17:58 UTC
Read the original article Hit count: 314

Filed under:
|
|

I recently set up a build server that requires a JDK to run (for example, to compile the Java sources). The OpenJDK package in Ubuntu pulls in the OpenJDK JRE as a dependency which, in turn, depends on a large number of packages that are only relevant for graphical environments. For the standard JRE, there's a headless version of the package, but for the JDK, no.

This issue has been discussed in various places before, and one solution that I found and used was this:

$ apt-get --no-install-recommends -d install openjdk-6-jdk
$ dpkg -i --ignore-depends=openjdk-6-jre /path/to/just-downloaded.deb

While this worked, it now leaves my system with a broken dependency tree and apt-get refuses further installs untill I run apt-get -f.

Is there a better solution to this?

© Server Fault or respective owner

Related posts about ubuntu

Related posts about headless