Incoming changes in JDK / JRE 21 packages may require manual intervention

The Arch team announced a possible manual intervention, they announced:
(Underneath is a literal quote from the Arch announcement)

We are introducing a change in JDK/JRE packages of our distro. This is
triggered from the way a JRE is build in modern versions of Java (>9). We are
introducing this change in Java 21.

To sum it up instead of having JDK and JRE packages coexist in the same system
we will be making them conflict. The JDK variant package includes the runtime
environment to execute Java applications so if one needs compilation and
runtime of Java they need only the JDK package in the future. If, on the other
hand, they need just runtime of Java then JRE (or jre-headless) will work.

This will (potentially) require a manual user action during upgrade:

  • if you have both JDK and JRE installed you can manually install the JDK
    with pacman -Sy jdk-openjdk and this removes the JRE related packages.
  • if you have both JRE and JRE-headless you will need to choose one of
    them and install it manually since they would conflict each other now.
  • If you only have one of the JDK/JRE/JRE-headless pacman should resolve
    dependencies normally and no action is needed.

At the moment this is only valid for the upcoming JDK 21 release.

https://archlinux.org/news/incoming-changes-in-jdk-jre-21-packages-may-require-manual-intervention/

18 Likes

I reread this a couple of times and it still makes no sense to me. I’ve had version 21 on my system for over a month, running sudo pacman -Syu jdk-openjdk does nothing but ask to reinstall it. I also have all (3) of the aforementioned packages:

yay -Qs jdk
local/jdk-openjdk 21.u35-3
    OpenJDK Java 21 development kit
local/jre-openjdk 21.u35-3
    OpenJDK Java 21 full runtime environment
local/jre-openjdk-headless 21.u35-3
    OpenJDK Java 21 headless runtime environment

Should I manually remove the (2) JRE packages?

1 Like

is it normal if I seemingly have none of them installed at all? :thinking:

I don’t believe java is installed by default, so if you don’t have any apps that need it it then it wont be installed.

AFAIK, the change hasent happened yet, but when it does, running that command with both the JDK and JRE installed will prompt you to uninstall the JRE.

Because the JDK includes the JRE, you don’t need the dedicated JRE package.

idk, I tried typing “JDK” and “JRE” into pacseek and got nothing that was labeled as “installed”. Hopefully that means I don’t need to do anything. I hope I don’t need to do anything in the future (after the update) either, if I ever happen to install one of the apps requiring this.

Usually you will not have any of them installed, I do not need any java env so I do not have any of them installed on my systems generally. No intervention needed for me :wink:

Yeah, the wording of the warning is misleading. The “upcoming JDK 21 release” occurred in September and nothing changed.

I just edited the original post, with the addition of the message being a literal quote from the official Arch announcement.

Thanks for the info, as always. It’s still the headline on the main Arch page, though. Sounds like someone over there jumped the gun.

Ok, I just had a little confusing update since I had both jre-openjdk and jre-openjdk-headless (previously “headless” was a direct dependency of jre-openjdk).
When I tried to update it failed with package conflict. Arch instruction did not help much. Running pacman -Syu jre-openjdk failed as well as pacman -Runs jre-openjdk-headless.

What worked was just running yay and selecting exclude package jre-openjdk-headless from update. Then it asked if it should be removed.

terminal output snippet
...

looking for conflicting packages...
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: jre-openjdk and jre-openjdk-headless are in conflict
 -> error installing repo packages
~ >1> yay
:: Synchronizing package databases...
 endeavouros is up to date
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
:: Searching AUR for updates...
:: Searching databases for updates...
:: 6 packages to upgrade/install.
6  endeavouros/eos-bash-shared  23.20-1  -> 23.21-1
5  extra/jre-openjdk            21.u35-3 -> 21.u35-7
4  extra/jre-openjdk-headless   21.u35-3 -> 21.u35-7
3  extra/libreoffice-still      7.5.7-3  -> 7.5.8-1
2  extra/qt6-base               6.6.0-2  -> 6.6.0-3
1  extra/suitesparse            7.3.0-1  -> 7.3.1-1
==> Packages to exclude: (eg: "1 2 3", "1-3", "^4" or repo name)
 -> Excluding packages may cause partial upgrades and break systems
==> 4
Sync Dependency (4): jre-openjdk-21.u35-7, qt6-base-6.6.0-3, suitesparse-7.3.1-1, eos-bash-shared-23.21-1
Sync Explicit (1): libreoffice-still-7.5.8-1
:: Synchronizing package databases...
 endeavouros is up to date
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
:: Starting full system upgrade...
warning: jre-openjdk-headless: ignoring package upgrade (21.u35-3 => 21.u35-7)
resolving dependencies...
looking for conflicting packages...
:: jre-openjdk and jre-openjdk-headless are in conflict. Remove jre-openjdk-headless? [y/N] y

...
5 Likes

The crux on the arch linux page says:

If you have both JDK and JRE installed you can manually install the JDK with pacman -Syu jdk-openjdk and this removes the JRE related packages.

This is INCORRECT. The command that fixed it for me was to drop the u option and just run pacman -Sy jdk-openjdk. I had the jdk, jre, and the headless jre installed. The command (without the u), ran without errors and let me make the correct selection.

3 Likes

I just encountered this change.

When I wanted to update my system with sudo pacman -Syu conflict between JDK and JRE popped up.

At first I thought that something was messed up because they worked fine together until today.

If I haven’t red this post I would of have reinstalled my Endeavours OS.

Thanks for the info it saved me from reinstalling.

I can say that this move from Arch team was dumb, because JDK 21 and JRE 21 where working just fine together.

Also when you want to install JDK ( sudo pacman -S jdk-openjdk) it installs jre-openjdk aswell.

:upside_down_face::upside_down_face::upside_down_face:

And you uninstalled JRE and JRE headless and left JDK on your system?

I ran sudo pacman -S jdk-openjdk and it prompted me to uninstall jre-openjdk and jre-openjdk headless which I did , then I upgraded jdk-openjdk and the conflict was gone.

2 Likes
:: jdk-openjdk and jre-openjdk-headless are in conflict. Remove jre-openjdk-headless? [y/N] y
error: failed to prepare transaction (could not satisfy dependencies)
:: removing jre-openjdk breaks dependency 'java-runtime-openjdk=20' required by java-openjfx
i got this message, what to do next?!
1 Like

Simply update it as descrbed by @Bryanpwo

Unfortunately terminal output is in German. Ja means Yes

➜  upd
eos-update: package updater with additional features
Updating...
[sudo] Passwort für swh: 
:: Paketdatenbanken werden synchronisiert …
 endeavouros                                                                            26,5 KiB   239 KiB/s 00:00 [--------------------------------------------------------------------] 100%
 core ist aktuell
 extra                                                                                   8,2 MiB  5,80 MiB/s 00:01 [--------------------------------------------------------------------] 100%
 multilib ist aktuell
:: Vollständige Systemaktualisierung wird gestartet …
Abhängigkeiten werden aufgelöst …
Nach in Konflikt stehenden Paketen wird gesucht …
Fehler: Nicht auflösbare Paketkonflikte gefunden
Fehler: Vorgang konnte nicht vorbereitet werden (In Konflikt stehende Abhängigkeiten)
:: jre-openjdk und jre-openjdk-headless stehen miteinander in Konflikt

sudo pacman -Sy jdk-openjdk
:: Paketdatenbanken werden synchronisiert …
 endeavouros ist aktuell
 core ist aktuell
 extra ist aktuell
 multilib ist aktuell
Abhängigkeiten werden aufgelöst …
Nach in Konflikt stehenden Paketen wird gesucht …
:: jdk-openjdk und jre-openjdk stehen miteinander in Konflikt. jre-openjdk entfernen? [j/N] j
:: jdk-openjdk und jre-openjdk-headless stehen miteinander in Konflikt. jre-openjdk-headless entfernen? [j/N] j

Paket (4)                      Alte Version  Neue Version  Netto-Veränderung  Größe des Downloads

extra/java-environment-common                3-5                    0,00 MiB             0,00 MiB
jre-openjdk                    21.u35-3                            -0,58 MiB                     
jre-openjdk-headless           21.u35-3                          -192,59 MiB                     
extra/jdk-openjdk                            21.u35-7            1136,48 MiB           457,81 MiB

Gesamtgröße des Downloads:              457,81 MiB
Gesamtgröße der installierten Pakete:  1136,48 MiB
Größendifferenz der Aktualisierung:     943,31 MiB

:: Installation fortsetzen? [J/n] j
:: Pakete werden empfangen …
 java-environment-common-3-5-any                                                         2,6 KiB  45,0 KiB/s 00:00 [--------------------------------------------------------------------] 100%
 jdk-openjdk-21.u35-7-x86_64                                                           457,8 MiB  6,28 MiB/s 01:13 [--------------------------------------------------------------------] 100%
 Gesamt (2/2)                                                                          457,8 MiB  6,28 MiB/s 01:13 [--------------------------------------------------------------------] 100%
(2/2) Schlüssel im Schlüsselbund werden geprüft                                                                    [--------------------------------------------------------------------] 100%
(2/2) Paket-Integrität wird überprüft                                                                              [--------------------------------------------------------------------] 100%
(2/2) Paket-Dateien werden geladen                                                                                 [--------------------------------------------------------------------] 100%
(2/2) Auf Dateikonflikte wird geprüft                                                                              [--------------------------------------------------------------------] 100%
:: Paketänderungen werden verarbeitet …
(1/2) Entfernung läuft jre-openjdk                                                                                 [--------------------------------------------------------------------] 100%
No Java environment is set as default anymore
(2/2) Entfernung läuft jre-openjdk-headless                                                                        [--------------------------------------------------------------------] 100%
(1/2) Installiert wird java-environment-common                                                                     [--------------------------------------------------------------------] 100%
(2/2) Installiert wird jdk-openjdk                                                                                 [--------------------------------------------------------------------] 100%
Optionale Abhängigkeiten für jdk-openjdk
    java-rhino: for some JavaScript support
    alsa-lib: for basic sound support [Installiert]
    gtk2: for the Gtk+ 2 look and feel - desktop usage [Installiert]
    gtk3: for the Gtk+ 3 look and feel - desktop usage [Installiert]
:: Post-transaction-Hooks werden gestartet …
(1/4) Arming ConditionNeedsUpdate...
(2/4) Refreshing PackageKit...
(3/4) Updating icon theme caches...
(4/4) Updating the desktop file MIME type cache...

Finally do the update

eos-update: package updater with additional features
Updating...
:: Paketdatenbanken werden synchronisiert …
 endeavouros ist aktuell
 core ist aktuell
 extra ist aktuell
 multilib ist aktuell
:: Vollständige Systemaktualisierung wird gestartet …
Abhängigkeiten werden aufgelöst …
Nach in Konflikt stehenden Paketen wird gesucht …

Paket (10)                   Alte Version  Neue Version  Netto-Veränderung  Größe des Downloads

extra/android-udev           20231030-1    20231104-1             0,00 MiB             0,01 MiB
endeavouros/eos-apps-info    23-3          23-4                   0,00 MiB             0,30 MiB
endeavouros/eos-bash-shared  23.20-1       23.21-1                0,00 MiB             0,05 MiB
extra/libnet                 2:1.1.6-1     2:1.3-1                1,17 MiB             0,29 MiB
extra/libreoffice-still      7.5.7-3       7.5.8-1               -0,01 MiB           150,15 MiB
extra/libreoffice-still-de   7.5.7-1       7.5.8-1                0,00 MiB             3,27 MiB
extra/qt6-base               6.6.0-2       6.6.0-3                0,00 MiB            13,63 MiB
extra/sof-firmware           2023.09-1     2023.09.1-1           -0,02 MiB             1,07 MiB
extra/suitesparse            7.3.0-1       7.3.1-1                0,00 MiB            22,39 MiB
extra/vtk                    9.2.6-10      9.2.6-11               0,00 MiB            56,09 MiB

Gesamtgröße des Downloads:              247,24 MiB
Gesamtgröße der installierten Pakete:  1020,00 MiB
Größendifferenz der Aktualisierung:       1,14 MiB

:: Installation fortsetzen? [J/n] j
:: Pakete werden empfangen …
 libreoffice-still-de-7.5.8-1-any                                                        3,3 MiB   871 KiB/s 00:04 [--------------------------------------------------------------------] 100%
 sof-firmware-2023.09.1-1-x86_64                                                      1091,7 KiB   292 KiB/s 00:04 [--------------------------------------------------------------------] 100%
 qt6-base-6.6.0-3-x86_64                                                                13,6 MiB  1450 KiB/s 00:10 [--------------------------------------------------------------------] 100%
 libnet-2:1.3-1-x86_64                                                                 295,0 KiB   139 KiB/s 00:02 [--------------------------------------------------------------------] 100%
 suitesparse-7.3.1-1-x86_64                                                             22,4 MiB  1669 KiB/s 00:14 [--------------------------------------------------------------------] 100%
 android-udev-20231104-1-any                                                            10,8 KiB  19,8 KiB/s 00:01 [--------------------------------------------------------------------] 100%
 eos-bash-shared-23.21-1-any                                                            52,8 KiB  20,2 KiB/s 00:03 [--------------------------------------------------------------------] 100%
 eos-apps-info-23-4-any                                                                307,7 KiB  47,3 KiB/s 00:07 [--------------------------------------------------------------------] 100%
 vtk-9.2.6-11-x86_64                                                                    56,1 MiB  2,27 MiB/s 00:25 [--------------------------------------------------------------------] 100%
 libreoffice-still-7.5.8-1-x86_64                                                      150,1 MiB  3,81 MiB/s 00:39 [--------------------------------------------------------------------] 100%
 Gesamt (10/10)                                                                        247,2 MiB  6,27 MiB/s 00:39 [--------------------------------------------------------------------] 100%
(10/10) Schlüssel im Schlüsselbund werden geprüft                                                                  [--------------------------------------------------------------------] 100%
(10/10) Paket-Integrität wird überprüft                                                                            [--------------------------------------------------------------------] 100%
(10/10) Paket-Dateien werden geladen                                                                               [--------------------------------------------------------------------] 100%
(10/10) Auf Dateikonflikte wird geprüft                                                                            [--------------------------------------------------------------------] 100%
:: Paketänderungen werden verarbeitet …
( 1/10) Aktualisiert wird android-udev                                                                             [--------------------------------------------------------------------] 100%
( 2/10) Aktualisiert wird eos-bash-shared                                                                          [--------------------------------------------------------------------] 100%
( 3/10) Aktualisiert wird eos-apps-info                                                                            [--------------------------------------------------------------------] 100%
( 4/10) Aktualisiert wird libnet                                                                                   [--------------------------------------------------------------------] 100%
( 5/10) Aktualisiert wird libreoffice-still                                                                        [--------------------------------------------------------------------] 100%
( 6/10) Aktualisiert wird libreoffice-still-de                                                                     [--------------------------------------------------------------------] 100%
( 7/10) Aktualisiert wird qt6-base                                                                                 [--------------------------------------------------------------------] 100%
( 8/10) Aktualisiert wird sof-firmware                                                                             [--------------------------------------------------------------------] 100%
( 9/10) Aktualisiert wird suitesparse                                                                              [--------------------------------------------------------------------] 100%
(10/10) Aktualisiert wird vtk                                                                                      [--------------------------------------------------------------------] 100%
:: Post-transaction-Hooks werden gestartet …
(1/9) Creating system user accounts...
(2/9) Reloading system manager configuration...
(3/9) Reloading device manager configuration...
(4/9) Arming ConditionNeedsUpdate...
(5/9) Updating the MIME type database...
(6/9) Refreshing PackageKit...
(7/9) Updating icon theme caches...
(8/9) Checking which packages need to be rebuilt
(9/9) Updating the desktop file MIME type cache...

4 Likes

I have no idea what to do

resolving dependencies…
looking for conflicting packages…
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: jre-openjdk and jre-openjdk-headless are in conflict
→ error refreshing databases - exit status 1
[csaba@csaba-mini ~]$ yay -R jre-openjdk-headless
checking dependencies…
error: failed to prepare transaction (could not satisfy dependencies)
:: removing jre-openjdk-headless breaks dependency ‘jre21-openjdk-headless=21.u35-3’ required by jre-openjdk
→ exit status 1

edit: fixed it
yay -R jre-openjdk
then install it, it will ask to replace the headless, dont know why it didn’t work with headless
yay jre-openjdk