Java update changes 'alternative' selection

I just updated (dnf) and java-latest-openjdk updated.
Before the update I had…

# alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
 + 1           java-latest-openjdk.x86_64 (/usr/lib/jvm/java-16-openjdk-16.0.2.0.7-1.rolling.fc34.x86_64/bin/java)
*  2           java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.12.0.7-4.fc34.x86_64/bin/java)
   3           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-2.fc34.x86_64/jre/bin/java)

Enter to keep the current selection[+], or type selection number: 

after the upgrade it became

# alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-2.fc34.x86_64/jre/bin/java)
*+ 2           java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.12.0.7-4.fc34.x86_64/bin/java)
   3           java-latest-openjdk.x86_64 (/usr/lib/jvm/java-17-openjdk-17.0.0.0.35-1.rolling.fc34.x86_64/bin/java)

I don’t remember this ever happening before; it changed from pointing at java-latest-openjdk to java-11.

Is this a problem with the rpm or is there some reason that it reset to the ‘default’ (Java 11).

1 Like

I don’t think this should happen. Best to file a bug so that you can discuss this with the maintainers. Even if they didn’t do it, something has changed a configuration you, the user, made, and that’s not something updates should do.

Done: 2007270 – Upgrade of java-latest-openjdk changes 'alternatives' java selection

1 Like

The bugzilla is being ignored :scream_cat: but on further investigation I think this is a bug with the install of java-11-openjdk which for some bazaar reason applies an enormous priority to it.

# alternatives --display java
java - status is manual.
 link currently points to /usr/lib/jvm/java-17-openjdk-17.0.0.0.35-1.rolling.fc35.x86_64/bin/java
/usr/lib/jvm/java-11-openjdk-11.0.12.0.7-4.fc35.x86_64/bin/java - family java-11-openjdk.x86_64 priority 11001207
- etc -
/usr/lib/jvm/java-17-openjdk-17.0.0.0.35-1.rolling.fc35.x86_64/bin/java - family java-latest-openjdk.x86_64 priority 1
- etc -
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-2.fc35.x86_64/jre/bin/java - family java-1.8.0-openjdk.x86_64 priority 1

The priority appears to correlate with the openjdk version – 11.0.12.0.7-4. That definitely looks like a bug.

2 Likes

Keen eye…well spotted!

It’s too early to say that yet. At the moment, let’s say that the maintainer hasn’t found the time to investigate/respond yet. I’ve pinged the bug and added a “needinfo” flag that will send the maintainer more reminders.