Score:0

Dependency on java17-runtime-headless installs Early Access package openjdk-18-jre-headless

gb flag

I'm trying to package a Java application which requires at Java 17 or above.

From what I understand of https://www.debian.org/doc/packaging-manuals/java-policy/ch02.html, I should not depend on the concrete openjdk-17-jre-headless package.

Instead I should use the virtual package corresponding the minimal JRE I need. In my case: java17-runtime-headless

The only problem I have is when I try to install my application with apt without a prior JRE installed, I get the following:

The following additional packages will be installed:
  ca-certificates-java openjdk-18-jre-headless

This is something I would like to avoid as openjdk-18-jre-headless is still an Early Access version. Currently 18~15ea-4

I haven't found so far in https://www.debian.org/doc/debian-policy/ch-relationships.html how I could express a dependency exclusion on early access packages.

My current solution is to express the dependency in my package as follow:

Depends: openjdk-17-jre-headless | java17-runtime-headless

But this is not perfect as if no package providing java17-runtime-headless is already installed, it would continue to install the JRE 17 even after the JRE 18 is not in Early Access anymore.

To summarize the question:

How to express a dependency to the latest non early access JRE available in the repositories?

What would be the recommendation in this case?

Regards,

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.