[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Packaging applications with JVM version restrictions



On Mon, 17 Apr 2023, Rob Browning wrote:

>Is there Is there a policy or preferred way to handle a package that
>needs a particular version or versions of java?  e.g. say it doesn't
>work with < 9.

From a Depends standpoint, java9-runtime-headless or java9-runtime. But…

>I could imagine it might not want to just rely on /usr/bin/java because
>you might not want it to break if the system has 8 and 11 installed, and
>then the local admin changes the default to 8 via update-alternatives.

… this is, indeed, possible: the Depends simply means it’s present,
not the default. (And that is a good thing.)

>To avoid that, I imagine the application's /usr/bin/something could
>examine $(update-alternatives --list java) to find a suitable version,
>but is that reasonable, or is there a preferable approach?

I’m a bit wary of auto-selecting something. I’d instead check whether
${JAVA:-java} has the right version and complain when not. Possibly
check whether $JAVA_HOME is set (which it isn’t in a regular Debian
one-JRE installation) and use that if suitable instead of complaining.
(Where complaining means echo "E: some msg" >&2; exit 1)

bye,
//mirabilos
-- 
Infrastrukturexperte • tarent solutions GmbH
Am Dickobskreuz 10, D-53121 Bonn • http://www.tarent.de/
Telephon +49 228 54881-393 • Fax: +49 228 54881-235
HRB AG Bonn 5168 • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

                        ****************************************************
/⁀\ The UTF-8 Ribbon
╲ ╱ Campaign against      Mit dem tarent-Newsletter nichts mehr verpassen:
 ╳  HTML eMail! Also,     https://www.tarent.de/newsletter
╱ ╲ header encryption!
                        ****************************************************


Reply to: