openjdk-6-jdk should depend on openjdk-6-jre-headless too

Bug #257857 reported by Torsten Krah on 2008-08-14
This bug affects 12 people
Affects Status Importance Assigned to Milestone
openjdk-6 (Ubuntu)
Nominated for Lucid by Oleg Godovykh
Nominated for Maverick by Oleg Godovykh

Bug Description

Binary package hint: openjdk-6-jdk

OpenJDK depends on:

Depends: libc6 (>= 2.3), libx11-6, openjdk-6-jre (>= 6b11-2ubuntu2), zlib1g (>= 1:

But it could and should depend on openjdk-6-jre OR openjdk-6-jre-headless. I don't need any of the bloated X references on a headless installation.
I would like to see this fixed.

Onkar Shinde (onkarshinde) wrote :

Can you please explain what do you mean by 'installation' here. Are you referring to installation of compiler (-jdk) or installation of (-jre).

In case you are referring to installation of compiler, I don't understand the need to have compiler installed without having complete JRE.

Torsten Krah (tkrah) wrote :

I want to install the JDK (not only the JRE).
But the JDK does depend "only" on the JRE yet, but it can (imho) depend on the JRE - headless install - too.
The headless JRE package is a "complete" JRE - but without the unneeded X stuff - its a server (headless).

Onkar Shinde (onkarshinde) wrote :

I was under the impression that jre-headless does not contain UI classes. May be I am wrong.

Matthias Klose (doko) wrote :

> I would like to see this fixed.

Is there any rationale besides this? why do you need to do development on a -headless installation?

Changed in openjdk-6:
status: New → Incomplete
Torsten Krah (tkrah) wrote :

Yes there is.
I don't need AWT & Co to run a webapplication container like jetty or tomcat - but both need a java compiler to compile jsps & co.
So imho yes, its rational to have only a headless jre installed and a javac compiler there.

Matthias Klose (doko) wrote :

in this case, we should introduce a openjdk-6-jdk-headless package (what a mess). just adding this alternative is wrong. please send a patch if possible.

Changed in openjdk-6:
importance: Undecided → Low
status: Incomplete → Triaged
Daniel Serodio (dserodio) wrote :

I want a "headless" JDK too. Couldn't the JDK depend on (openjdk-6-jre|openjdk-6-jre-headless) or such?

Matthias Klose (doko) wrote :

> I want a "headless" JDK too.

No, you don't get a pony.

> Couldn't the JDK depend on (openjdk-6-jre|openjdk-6-jre-headless) or such?


Again, how does such a openjdk-6-jdk-headless package look like?

Nicolas Lehuen (nicolas-lehuen) wrote :

The JRE has the concept of graphical toolkits (AWT Toolkits) that vary depending on the platform it runs on. Those toolkits are Java classes implementing the UI layer through native calls, so there are toolkits for Mac, Windows, and I assume there are different X11 toolkits for Linux depending on the fact that you use Motif / GTK / QT etc.

The JRE can operate in headless mode. Before this (in a far far past), we had to run JDK along with xvfb in order to perform some graphical operation like image manipulation, even on a server. With the headless mode, no need for a virtual X11 server, no need for X11 at all. So the toolkit and its dependencies (a gazillion of megabytes of unicode fonts, for instance) are no more needed. I guess that was the whole purpose of making a special openjdk-6-jre-headless package, it comes without the toolkit.

Running the openjdk-6-jdk JDK (i.e. development tools like the javac compiler) on openjdk-6-jre-headless makes sense, for that except for a few tools like jconsole, everything runs in command line and doesn't require a GUI. Moreover, most of the time there is no mention of toolkit classes in standard Java code (for the good reason that the toolkit classes are implementation dependent and not part of the public API), so compiling some code should not break in a headless environment.

So there are three possibilities :

1) just let things as they are now, forcing everyone who want to have a web application with dynamic compilation of JSP to download the whole X11 toolkit and dependencies even though it won't work anyway. Note that there are some application server that provide their own compiler (the Eclipse one IIRC) so sidestep this whole issue.
2) make openjdk-6-jdk depend on openjdk-6-jre OR openjdk-6-jre-headless
3) make a new openjdk-6-jdk-headless depending on openjdk-6-jre-headless and take this opportunity to remove graphical tools like jconsole from the headless JDK. This is the one that requires most work, and I'm not sure it will be very effective in savings contrary to the previous option.

I think Nicolas' option 2) is very reasonable.

The java compiler is not just necessary for JSP compilation but for a whole range of normal server side Java deployment scenarios which depend on ant and javac.

Is there any good temporary workaround? The best I could find was

sudo apt-get --no-install-recommends -d install openjdk-6-jdk
sudo dpkg -i --ignore-depends=openjdk-6-jre /var/cache/apt/archives/openjdk-6-jdk_6b14-1.4.1-0ubuntu7_i386.deb

Best regards,

Matthias Klose (doko) wrote :

2) is the only option which is *not* reasonable, breaking update-java-alternatives(8) and leaving dangling symlinks. If you want to work on 3), you have to update the update-java-alternatives(8) program as well, and change this in all of gcj-4.3, gcj-4.4, openjdk-6, sun-java5 and sun-java6.

raju (farthest3) wrote :

i tried to install openjdk6 on UBUNTU 8 which i got as a free cd but i am having a problem installing it as my pc does not have internet connection i have downloaded the required files but cannot satisfy the dependencies ,

error :
ant depends on openjdk6-jre-headless , but to install openjdk6-jre-headless ant should be installed so
how do i install openjdk6 on my pc .

there are a lot of such error which seem like the packages are inter dependent so i cannot install open jdk6 on my system
so pls help

dronus (paul-geisler) wrote :

As for 2012 still not possible to compile java without bloating the installed system to about twice the amount of installed packages? What happens if JDK is installed while ignoring it X11 dependencies? It seems javac runs well either.
How about an extraction of javac and its true dependencies to a small package that the whole JDK depends on, but can be installed solely as well without the need for X and any GUI dependent tools? I like to ssh my server and build code under construction.

Joan Maspons (jmaspons) wrote :

Same problem in 14.04

Benoit Sigoure (tsunanet) wrote :

There are various non-GUI debugging tools (jps, jstack, jstat, etc) that only come with the -jdk package, yet are very useful for debugging on servers. The compilation tools (javac) are very useful in headless CI environments. It's kind of a shame that we have to pull all these X11, Gnome and other sound-system dependencies on a lot of servers, all for nothing.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers