View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0017323||CentOS-8||java||public||2020-05-04 16:56||2020-05-04 16:56|
|Target Version||Fixed in Version|
|Summary||0017323: Java 11 has unfortunately low priority in alternatives database|
|Description||When Java 1.8 and Java 11 are both installed on a system, the "alternatives" system always sets Java 1.8 as the default Java to use, even though Java 11 is more current.|
I find this to be surprising behavior. It is also unfortunate behavior as Java 1.8 has a TLS handshake negotiation bug that causes it to fail TLS handshakes as a client when negotiating a connection with another CentOS 8 system that uses the OpenSSL library (which is what brought this problem to my attention initially.)
|Steps To Reproduce||Install java-11-openjdk-headless.x86_64 (1:184.108.40.206-1.el8_1). If necessary, install java-1.8.0-openjdk-headless.x86_64 (1:220.127.116.11.b09-2.el8_1). Run "alternatives --list" and see that the system has chosen Java 1.8. For good measure, run "alternatives --auto" and see that it still prefers Java 1.8.|
Go to /var/lib/alternatives and examine the files there. You will see that Java 1.8 has a priority of 1800252 and that Java 11 has a priority of 1. Alternatives always chooses the package with the highest priority.
|Additional Information||Workarounds include:|
- use the alternatives command to manually set Java 11 as the default. This is difficult to automate in a maintainable way.
- stomp on the version number of the Java 11 entries in /var/lib/alternatives with an arbitrarily large priority. More heavy handed, but seems to be easier to automate in a generalized way.
Both of these methods are likely to produce undesirable behavior as newer Java major releases become available.
|Tags||No tags attached.|