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,