adoptium / adoptium/installer

jcmd should be slave of java, not of javac, to be better aligned with upstream and Fedora/RHEL downstreams

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

Description

Fedora users have reported an issue (email on jdk-team) that jcmd is disappearing if both temurins and system jdks are installed and used:

If you have (or even had!) installed temurin jdk together with our packages, even slightest switching of java/javac master via alternatives is making jcmd disapear:
```
sh-5.3$ sudo alternatives --set java /usr/lib/jvm/java-25-openjdk/bin/java
sh-5.3$ readlink `which jcmd ` -f
/usr/lib/jvm/java-25-openjdk/bin/jcmd
sh-5.3$ sudo alternatives --set javac /usr/lib/jvm/java-25-openjdk/bin/javac
sh-5.3$ readlink `which jcmd ` -f
which: no jcmd in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/home/jvanek/bin)
sh-5.3$ sudo alternatives --set java /usr/lib/jvm/java-25-openjdk/bin/java
sh-5.3$ readlink `which jcmd ` -f
/usr/lib/jvm/java-25-openjdk/bin/jcmd
```
So I thought that temurin is being unset by javac master. So removing what java master set.
However I remove all temurin jdks temruin jdk:
```
sh-5.3$ sudo alternatives --set java /usr/lib/jvm/java-25-openjdk/bin/java
sh-5.3$ readlink `which jcmd ` -f
/usr/lib/jvm/java-25-openjdk/bin/jcmd
sh-5.3$ sudo alternatives --set javac /usr/lib/jvm/java-25-openjdk/bin/javac
sh-5.3$ readlink `which jcmd ` -f
which: no jcmd in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/home/jvanek/bin)
```
If you would cat /var/lib/alternatives/java | grep jcmd and/or cat /var/lib/alternatives/javac | grep jcmd you will find, that alternatives (as some safety mechanism) keeps the javac record even after temurin jdk removal.

Fedora was for now switched to use jcmd under java master, however for rhel was opened, and closed the https://redhat.atlassian.net/browse/OPENJDK-4819, as it would mean revert of https://redhat.atlassian.net/browse/RHEL-12344

based on above, I will switch Fedora back (as the switch itself is harmless) to remain aligned with RHEL

Contributor guide

Open the contributing guide

Research direction

The issue identifies the java and javac alternatives records, /var/lib/alternatives/java and /var/lib/alternatives/javac, and the jcmd entry point; no repository file or test is named. Start by locating the installer scripts that register jcmd and reproduce the alternatives switching sequence. Done means jcmd remains available after changing javac and matches the intended Fedora and RHEL relationship.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
release
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.