Score:1

Yum dependencies and metadata for java-headless

in flag

I'm trying to install Java 8 and Tomcat 9 on a RockyLinux 9 server.

Installing tomcat (from EPEL) requires java-headless >= 1:1.8.0 which is resolved to java-11-openjdk-headless. So Java 11 gets installed as a dependency... even though I have already installed java-1.8.0-openjdk-headless and it should, 'logically', provide java-headless >= 1:1.8.0.

$ yum deplist tomcat
Last metadata expiration check: 1:37:02 ago on Tue 28 Mar 2023 04:13:15 PM CEST.
package: tomcat-1:9.0.65-2.el9.noarch
[...]
  dependency: java-headless >= 1:1.8.0
   provider: java-11-openjdk-headless-1:11.0.18.0.10-2.el9_1.x86_64
[...]

I guess java-1.8.0-openjdk-headless lacks the Provides: java-headless metadata. It is not in the yum whatprovides java-headless output. But I'm not sure how I can check the full metadata of java-1.8.0-openjdk-headless.

Is there a way to:

  • force yum to ignore the java-headless dependency ?
  • mark java-1.8.0-openjdk-headless as providing this dependency ?

or any other option that would allow me to avoid :

  1. installing Java 11 for no use
  2. forcing Java version through alternatives or through tomcat configuration ?

EDIT: Java 8 and 11 both get installed without conflict. I would just like to avoid installing Java 11. Tomcat 9 is compatible with Java 8 and runs fine after selecting Java 8 from update-alternatives.

John Mahowald avatar
cn flag
What do you have installed that needs `java-1.8.0-openjdk-headless` ?
nathou avatar
in flag
I have installed it. The app I need to run on Tomcat requires this version of Java exactly.
Score:0
by flag

You have a version dependency conflict while installing Tomcat 9 on your RockyLinux 9 server.

The best way to fix that would be to install Java 8 separately, but since you have it already you can install Java 8 Development Kit (JDK) separately then set JAVA_HOME environment variable to point to the Java 8 installation directory.

So first download the Java 8 JDK from the Oracle website or through the OpenJDK repository, then set JAVA_HOME environment variable in the /etc/profile file or in the Tomcat startup script (/usr/share/tomcat/bin/catalina.sh) it should be export JAVA_HOME=/path/to/java8

nathou avatar
in flag
Sorry if the question was not clear enough, I have edited it. There is no conflict between versions, they get installed side-by-side correctly. I know there are multiple ways of telling tomcat which Java to use, I would just like to avoid installing Java 11 if possible.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.