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.
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.
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)
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! ****************************************************
targets the lowest installed JVM which version is greater or equals to
Besides, what’s compatible? Some things may run with an older/newer
JRE but others won’t.
From the point of view of a Java application developer, I can provide alist of JDK versions my application can be run with.
Debian would need to provide a way to perform the "JRE with exact java $version exists"
check. This could be done by providing stable symlinks, or alternatives like /etc/alternatives/jre_<VERSION>
From what I've seen of the java-wrappers package, it seems to solve the problemin a single direction: specifying the minimum JVM's version, but not the maximum.
On Wed, 19 Apr 2023 09:48:54 +0000, Loïc Rouchon wrote:
Debian would need to provide a way to perform the "JRE with exact java $version exists"
check. This could be done by providing stable symlinks, or alternatives like
/etc/alternatives/jre_<VERSION>
(I haven't read the complete thread in detail, so this might be not completely appropriate):
There's also the java-wrappers package which helps to find java
runtimes from shell wrapper scripts.
Cheers,
gregor
--
.''`. https://info.comodo.priv.at -- Debian Developer https://www.debian.org : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06` . `' Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe` -
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 25:50:22 |
Calls: | 6,707 |
Calls today: | 1 |
Files: | 12,239 |
Messages: | 5,352,401 |