adoptium / adoptium/installer

update-alternative says "jfr can't be slave of javac" when installing temurin-11-jre and temurin-17-jdk

Open
#1,194 1 comment 0 reactions 0 assignees View on GitHub
Linux
Dominant language
Jinja
Stars
168
Forks
77
Avg merge
2d 14h
Merged PRs (30d)
12

Description

### Please provide a brief summary of the bug

We are running SuSE Enterprise Linux Server 15, ServicePack 6, and using the RPMs provided at https://adoptium.jfrog.io/artifactory/rpm/sles/15/x86_64/

We noticed that when installing temurin-11-jre followed by temurin-17-jdk , the RPM postscriptlet fails with

update-alternatives: error: alternative jfr can't be slave of javac: it is a slave of java
warning: %post(temurin-17-jdk-17.0.15.0.0.6-0.x86_64) scriptlet failed, exit status 2

We are leaving the update-altenatives untarnished in automatic mode. The problem seems to be that both temurin-11-jre and temurin-17-jdk both have "jfr" defined as slaves in the link groups of update-alternatives. temurin-11-jre has it jfr defined in its "java" link group, while temurin-17-jdk has jfr defined as slave in its "javac" link group.
This leads to the collision in the RPM postscriptlet.

# update-alternatives --display java
java - auto mode
link best version is /usr/lib64/jvm/temurin-17-jdk/bin/java
link currently points to /usr/lib64/jvm/temurin-17-jdk/bin/java
link java is /usr/bin/java
slave jaotc is /usr/bin/jaotc
slave java.1 is /usr/share/man/man1/java.1
slave jexec is /usr/bin/jexec
slave jfr is /usr/bin/jfr

# update-alternatives --display javac
update-alternatives: error: no alternatives for javac

(because installation of the latter link group failed with above error message)

### Did you test with the latest update version?

- [x] Yes

### Please provide steps to reproduce where possible

Use SuSE Enterprise Linux Server 15, ServicePack 6

From https://adoptium.jfrog.io/artifactory/rpm/sles/15/x86_64/

install temurin-11-jre followed by temurin-17-jdk

> zypper install temurin-11-jre
...
update-alternatives: using /usr/lib64/jvm/temurin-11-jre/bin/java to provide /usr/bin/java (java) in auto mode
(1/1) Installing: temurin-11-jre-11.0.27.0.0.6-0.x86_64
...

> zypper install temurin-17-jdk
....
update-alternatives: using /usr/lib64/jvm/temurin-17-jdk/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: error: alternative jfr can't be slave of javac: it is a slave of java
warning: %post(temurin-17-jdk-17.0.15.0.0.6-0.x86_64) scriptlet failed, exit status 2
(1/1) Installing: temurin-17-jdk-17.0.15.0.0.6-0.x86_64

### Expected Results

> zypper install temurin-17-jdk
succeeding without postscriptlet errors

### Actual Results

update-alternatives: using /usr/lib64/jvm/temurin-17-jdk/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: error: alternative jfr can't be slave of javac: it is a slave of java
warning: %post(temurin-17-jdk-17.0.15.0.0.6-0.x86_64) scriptlet failed, exit status 2

### What Java Version are you using?

11 and 17

### What is your operating system and platform?

SuSE Enterprise Linux 15, SP 6

### How did you install Java?

With the zypper package manager

### Did it work before?

```Shell
yes, it did work like 6 months ago or so
```

### Did you test with other Java versions?

```Shell

```

### Relevant log output

```Shell

```

Contributor guide

Open the contributing guide

Research direction

Reproduce the installation sequence with zypper on SLES 15 SP6: install temurin-11-jre, then temurin-17-jdk, and inspect the RPM postscriptlet calls to update-alternatives. Compare the java and javac link groups, including the jfr slave; done means the second package installs without a postscriptlet error and both link groups are configured correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, linux
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.