1

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.

nathou
  • 163
  • 6

1 Answers1

0

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

Saxtheowl
  • 1,112
  • 5
  • 8
  • 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. – nathou Mar 30 '23 at 07:43