installer icon indicating copy to clipboard operation
installer copied to clipboard

Problems installing temurin-17-jdk-17.0.1.0.0.12-1.x86_64.rpm under OpenSUSE

Open KritonK opened this issue 3 years ago • 5 comments
trafficstars

I installed temurin-17-jdk from the OpenSUSE 15.2 repo. The installation more or less succeeded, except that no alternative was installed for the java command. The following messages were produced during installation:

Additional rpm output: update-alternatives: error: alternative jrunscript can't be slave of java: it is a slave of javac update-alternatives: using /usr/lib64/jvm/temurin-17-jdk/bin/javac to provide /usr/bin/javac (javac) in auto mode update-alternatives: warning: skip creation of /usr/bin/jaotc because associated file /usr/lib64/jvm/temurin-17-jdk/bin/jaotc (of link group javac) doesn't exist update-alternatives: warning: skip creation of /usr/bin/rmic because associated file /usr/lib64/jvm/temurin-17-jdk/bin/rmic (of link group javac) doesn't exist update-alternatives: warning: skip creation of /usr/share/man/man1/rmic.1 because associated file /usr/lib64/jvm/temurin-17-jdk/man/man1/rmic.1 (of link group javac) doesn't exist

Looks like alternatives are not updated correctly after installation.

I added the alternative for java manually, using: update-alternatives --install /usr/bin/java java /usr/lib64/jvm/temurin-17-jdk/bin/java 1 and now java runs fine.

I am actually using OpenSUSE Tumbleweed, but the 15.2 executables run fine. I would have used the 15.3 repo, but there is no temurin-17-jdk package there yet.

KritonK avatar Jan 03 '22 11:01 KritonK

I'ved added the missing JDK17 package to 15.3. I don't see your error though:

Additional rpm output:
update-alternatives: using /usr/lib64/jvm/temurin-17-jdk/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: warning: skip creation of /usr/bin/jjs because associated file /usr/lib64/jvm/temurin-17-jdk/bin/jjs (of link group java) doesn't exist
update-alternatives: warning: skip creation of /usr/bin/pack200 because associated file /usr/lib64/jvm/temurin-17-jdk/bin/pack200 (of link group java) doesn't exist
update-alternatives: warning: skip creation of /usr/bin/rmid because associated file /usr/lib64/jvm/temurin-17-jdk/bin/rmid (of link group java) doesn't exist
update-alternatives: warning: skip creation of /usr/bin/unpack200 because associated file /usr/lib64/jvm/temurin-17-jdk/bin/unpack200 (of link group java) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/jjs.1 because associated file /usr/lib64/jvm/temurin-17-jdk/man/man1/jjs.1 (of link group java) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/pack200.1 because associated file /usr/lib64/jvm/temurin-17-jdk/man/man1/pack200.1 (of link group java) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/rmid.1 because associated file /usr/lib64/jvm/temurin-17-jdk/man/man1/rmid.1 (of link group java) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/unpack200.1 because associated file /usr/lib64/jvm/temurin-17-jdk/man/man1/unpack200.1 (of link group java) doesn't exist
update-alternatives: using /usr/lib64/jvm/temurin-17-jdk/bin/javac to provide /usr/bin/javac (javac) in auto mode
update-alternatives: warning: skip creation of /usr/bin/jaotc because associated file /usr/lib64/jvm/temurin-17-jdk/bin/jaotc (of link group javac) doesn't exist
update-alternatives: warning: skip creation of /usr/bin/rmic because associated file /usr/lib64/jvm/temurin-17-jdk/bin/rmic (of link group javac) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/rmic.1 because associated file /usr/lib64/jvm/temurin-17-jdk/man/man1/rmic.1 (of link group javac) doesn't exist
a802edbeed04:/ # java -version 
openjdk version "17.0.1" 2021-10-19
OpenJDK Runtime Environment Temurin-17.0.1+12 (build 17.0.1+12)
OpenJDK 64-Bit Server VM Temurin-17.0.1+12 (build 17.0.1+12, mixed mode, sharing)

gdams avatar Jan 05 '22 18:01 gdams

Thanks for the 15.3 package!

Looking further into the issue, the update-alternatives: error: alternative jrunscript can't be slave of java: it is a slave of javac error is caused by a conflict between the alternatives configured by temurin-17-jdk and the openjdk packages provided by OpenSUSE (I have java-17-openjdk-17.0.1.0-2.1, java-17-openjdk-devel-17.0.1.0-2.1, and java-17-openjdk-headless-17.0.1.0-2.1), which had been installed as dependencies from other packages. I had to remove them using rpm --erase --nodeps for testing, as zypper remove produced tons of error messages. Installing temurin-17-jdk, after manually removing these three packages, made the error go away. Removing temurin, reinstalling the three packages, then reinstalling temurin, made the error reappear.

KritonK avatar Jan 06 '22 12:01 KritonK

Hmm interesting, I wonder if we can define those java-x packages as conflicts to automatically wipe them as part of the temurin install

gdams avatar May 04 '22 11:05 gdams

The Temurin rpm would have to provide whatever the java-17-openjdk* packages provide, which is quite a long list, probably distribution-dependent, and possibly against the spirit of packaging java, which seems to allow the concurrent installation of various versions/implementations.

Stupid suggestion: could you adapt their spec file to Temurin? This would help create the required conflict and/or create compatible java and javac alternatives. The source RPM is here.

Meanwhile, yesterday I installed temurin-18-jdk-18.0.0.0.0.36-1.x86_64.rpm, and I had to update the java and javac alternatives by hand, as I got the update-alternatives: error: alternative jrunscript can't be slave of java: it is a slave of javac error again.

KritonK avatar May 04 '22 12:05 KritonK

This looks like a discrepancy in Temurin. JEP https://openjdk.java.net/jeps/8278252 lists the two groups for java and javac where jrunscript is under javac

Upstream Fedora also links jrunscript to javac: https://src.fedoraproject.org/rpms/java-17-openjdk/blob/rawhide/f/java-17-openjdk.spec#_641

Temurin currently links it to java: https://github.com/adoptium/installer/blob/master/linux/jdk/suse/src/main/packaging/temurin/17/temurin-17-jdk.spec#L184

jiekang avatar Jun 10 '22 19:06 jiekang

@jiekang would you be happy to submit a pull request to fix this?

gdams avatar Jan 05 '23 17:01 gdams

@jiekang would you be happy to submit a pull request to fix this?

Yes, I'll work on a PR.

jiekang avatar Jan 13 '23 16:01 jiekang