Bug 1924854 - Installing devel package does not update the existing java headless installation.
Summary: Installing devel package does not update the existing java headless installat...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: java-11-openjdk
Version: 33
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: jiri vanek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-03 18:35 UTC by Jeremy Whiting
Modified: 2021-02-10 16:04 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-09 10:05:41 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Diff file containing changes to install alternatives follower (slave) for each sub-command. (10.30 KB, text/plain)
2021-02-08 12:26 UTC, Jeremy Whiting
no flags Details
java alternatives on system (25.67 KB, text/plain)
2021-02-08 18:40 UTC, Jeremy Whiting
no flags Details

Description Jeremy Whiting 2021-02-03 18:35:26 UTC
Description of problem:

 Missing slave configuration for java-11-openjdk-devel package tooling.

Version-Release number of selected component (if applicable):

$ java -version
openjdk version "11.0.9.1" 2020-11-04
OpenJDK Runtime Environment 18.9 (build 11.0.9.1+1)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.9.1+1, mixed mode, sharing)
$

How reproducible:

always

Steps to Reproduce:
1. dnf install -y java-11-openjdk-devel
2. jps
3.

Actual results:

$ jps
bash: jps: command not found...
Failed to search for file: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not activate remote peer.
$

Expected results:

$ /usr/lib/jvm/java-11-openjdk/bin/jps
23711 Jps
$

Additional info:

 When poking around the java-11-openjdk spec file I notice the command to configure alternatives differs between headless and devel.

$ cat *.spec | grep -e --install -e --slave -e post_ |grep -B 1 install
# you can list those files, with appropriate sections: cat *.spec | grep -e --install -e --slave -e post_ 
--
%define post_headless() %{expand:
  --install %{_bindir}/java java %{jrebindir -- %{?1}}/java $PRIORITY  --family %{name}.%{_arch} \\
--
  --slave %{_mandir}/man1/unpack200.1$ext unpack200.1$ext \\
  alternatives --install %{_jvmdir}/jre-"$X" jre_"$X" %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY --family %{name}.%{_arch}
update-alternatives --install %{_jvmdir}/jre-%{javaver}-%{origin} jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk -- %{?1}} $PRIORITY  --family %{name}.%{_arch}
%define post_devel() %{expand:
  --install %{_bindir}/javac javac %{sdkbindir -- %{?1}}/javac $PRIORITY  --family %{name}.%{_arch} \\
--
  --slave %{_mandir}/man1/serialver.1$ext serialver.1$ext \\
    --install %{_jvmdir}/java-"$X" java_sdk_"$X" %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY  --family %{name}.%{_arch}
update-alternatives --install %{_jvmdir}/java-%{javaver}-%{origin} java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY  --family %{name}.%{_arch}
%define post_javadoc() %{expand:
  --install %{_javadocdir}/java javadocdir %{_javadocdir}/%{uniquejavadocdir -- %{?1}}/api \\
%define post_javadoc_zip() %{expand:
  --install %{_javadocdir}/java-zip javadoczip %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip \\
$

 On the one hand headless is using java whereas devel uses javac as the master symbolic name.

 My expectation when devel package is installed there should be multiple alternatives --add-slave commands to update the previously installed headless java package. 

 for example when I do this

$ sudo alternatives --add-slave java /usr/lib/jvm/java-11-openjdk-11.0.9.11-4.fc33.x86_64/bin/java /usr/bin/jps jps /usr/lib/jvm/java-11-openjdk-11.0.9.11-4.fc33.x86_64/bin/jps
[sudo] password for whitingjr: 
$ jps
24837 Jps
6748 jedit.jar
20911 org.eclipse.equinox.launcher_1.5.800.v20200727-1323.jar
$

 after running the alternatives command the jps tool is recognized by the platform.

Comment 1 Jeremy Whiting 2021-02-08 12:26:51 UTC
Created attachment 1755705 [details]
Diff file containing changes to install alternatives follower (slave) for each sub-command.

A diff file with changes to the spec file.

Comment 2 jiri vanek 2021-02-08 16:31:15 UTC
Hi!

I can not reproduce the jps issue you are encountering. After all - if javac master would stop working, that would stop the world.
There is known issue with reinstall - https://bugzilla.redhat.com/show_bug.cgi?id=1200302 workaround is to run reinstall again.

Your system must have been somehow misconfiguration, or something went wild during move of jdk11 to mian JDK - https://fedoraproject.org/wiki/Changes/Java11

The java and javac masters are intentionally separated. On java master are JRE slaves, on javac master are JDK slaves.

jps is hard to say why, part of JDK. So to use it you need to install java-11-openjdk-devel as you are doing, and select it via javac master.

Why it is not preselected on your setup is really weird. Have you tried clean VM/chroot?  As I'm saying something, I'm unable to reproduce.  So some missconfiguraton had to happen on your system. Eg any other java?

Comment 3 Jeremy Whiting 2021-02-08 18:16:50 UTC
 While misconfiguration is always a possibility :) I suspect the install of the package must have borked. This might be way back when the F33 image was originally cut. I did a fresh F33 install in Nov 2020.

 I can find no alternatives javac master on my system.

$ sudo alternatives --display javac
[sudo] password for whitingjr: 
failed to read link /usr/bin/javac: No such file or directory
$ 

 I'll add as an attachment my alternatives on F33 for java.
 Next I'll attempt a reinstall of devel.

Comment 4 Jeremy Whiting 2021-02-08 18:40:18 UTC
Created attachment 1755776 [details]
java alternatives on system

ok, this shows the jdk being mapped to is jdk17 with loom. but the net effect is the same when executing commands configured with alternatives.

Comment 5 Jeremy Whiting 2021-02-08 20:25:56 UTC
 Re-installing the devel package solved the problem. The javac command now has 2 alternatives.

I am happy for this issue to be closed.

Comment 6 jiri vanek 2021-02-10 10:57:15 UTC
If the reinstall helped, then I think the https://bugzilla.redhat.com/show_bug.cgi?id=1200302 w was real cause. Sorry and ty!

Comment 7 Jeremy Whiting 2021-02-10 16:04:58 UTC
(In reply to jiri vanek from comment #6)
> If the reinstall helped, then I think the
> https://bugzilla.redhat.com/show_bug.cgi?id=1200302 w was real cause. Sorry
> and ty!

 Reinstall didn't work. But the workaround (downgrade then upgrade) in the comment https://bugzilla.redhat.com/show_bug.cgi?id=1200302#c76 worked for me.
 All sorted. Thank you.


Note You need to log in before you can comment on or make changes to this bug.