2

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.

Thomas S.
  • 753
  • 2
  • 13
  • 28
  • 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

1 Answers1

2

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.

Darth Android
  • 37,872
  • 5
  • 94
  • 112
  • 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