Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently in the progress of creating a .deb package of our Java-based application, especially for Ubuntu users. Our application runs with the JRE 1.6 and 1.7 from OpenJDK (openjdk-6-jre-headless and openjdk-7-jre-headless), but the use of JRE 1.7 is preferred. Because of that, I'm using

Recommends: openjdk-7-jre-headless

but I'm unsure whether this is the correct dependency. When installing our bundle and neither openjdk-6-jre-headless nor openjdk-7-jre-headless is installed, it should install openjdk-7-jre-headless.

share|improve this question
Not sure why you deleted your old question... You should depend upon default-jre-headless (>= 1.6) (which is filled by openjdk-7-jre-headless by default, but allows any 1.6 or newer JRE that the user has installed to work). You don't need to recommend anything, as the user will get the recommended JRE if they don't have one installed, otherwise, they already have a JRE installed and you should use that. – Darth Android Jul 24 '13 at 16:49
up vote 1 down vote accepted

You should depend upon java-runtime-headless (>= 1.6) (which is filled by openjdk-7-jre-headless, and allows any 1.6 or newer JRE that the user has installed to work).

This allows for much more flexibility. For example, I run oracle-java8-jdk on my system; this provides default-jre-headless 1.8 (as well as java7-runtime-headless, java6-runtime-headless, and java5-runtime-headless), but any dependencies upon openjdk would most likely result in me not installing your program because I have no desire to install an older JRE.

share|improve this answer
I have installed openjdk-7-jre-headless on my machine and my application works. When I try to run sudo apt-get install default-jre-headless it wants to download further ~35 MB and install that. I want to avoid this additional bloat if it's not necessary. – Thomas S. Jul 24 '13 at 18:22
@ThomasS. Whoops. Seems java-runtime-headless is the correct virtual package to put as a dependency, with openjdk-7-jre-headless as recommended. I don't have any direct experience with this, so please continue to comment on what you figure out. – Darth Android Jul 24 '13 at 18:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.