If you try to install tomcat package, a default OpenJDK JRE (starting from 1.8.0) is installed. If you choose the OpenJDK version, using "java-XX-openjdk" package, all deps are satisfied. If you use another java (corretto, temurin) you'll install java-1.8.0-openjdk package, so it seems that the tomcat packate doesn't recognize if a valid JAVA binary is available on the server or not. Reproducible: Always Steps to Reproduce: 1. install system 2. install corretto/temurin repo 3. install corretto/temurin java jdk/jre 4. install tomcat package Actual Results: java-1.8.0-openjdk package is installed Expected Results: a "pass" check that a JAVA binary is installed should be pass and no other packages should be installed on the system.
The issue most likely stems from the java-headless (or java) requires at https://src.fedoraproject.org/rpms/tomcat/blob/rawhide/f/tomcat.spec#_113 not being met by the JDK package you're using. Can you provide the output of `rpm -q --provides` for the corretto/temurin java package? We can also look into making the requires more flexible, but ran into some issues with that in the past. Thanks for the report!
hello, thank you for your reply and your willingness to think about possible improvement! From a "temurin-machine" I get: $ rpm -q --provides temurin-21-jre jre jre-21 jre-21-headless jre-21-openjre jre-21-openjre-headless jre-headless jre-openjre jre-openjre-headless temurin-21-jre = 21.0.7.0.0.6-0 temurin-21-jre(x86-64) = 21.0.7.0.0.6-0
After thorough investigation, the root of this behavior appears to be the `ecj` package, which is a runtime dependency of Tomcat. Although Tomcat itself is compatible with third-party Java runtimes like Eclipse Temurin (e.g., `temurin-21-jre`), the installation of `ecj` triggers the installation of Fedora’s `java-21-openjdk-headless`. This is because `ecj` is a hybrid package that acts both as a Java library and as a command-line tool, and its current packaging imposes a hard requirement on Fedora’s OpenJDK. (More details here: https://bugzilla.redhat.com/show_bug.cgi?id=2376795) As a result, users trying to run Tomcat with a different JRE will see OpenJDK pulled in even when a valid runtime is already installed.Since there is no strong demand for this change, we therefore do not plan to modify the package at this time. We recommend third-party JRE users apply a manual workaround, such as: dnf install tomcat --exclude='java*-openjdk*' This limitation may be revisited in the future if broader demand emerges or if higher-level compatibility requirements arise.
OK, so it will install java-*-openjdk package...but the real question, at this point is: which java runtime will use to run the tomcat package?
By default tomcat uses whatever JRE is set as the system default. So even though java-*-openjdk-headless may be installed as a side-effect, tomcat will not necessarily use it at runtime.
MMH, this is not good because "not necessarily use it at runtime" means also "can be used"...so maybe you're installing a temurin21, but openjdk8 is installed as side-effect, and tomcat can run with openjdk8 instead of temurin21.
Fedora’s current default OpenJDK is version 21, not 8. Fedora 41 & 42, currently ship Tomcat 9 which supports Java >= 8. The upcoming Tomcat 10 in Fedora 43, requires Java >= 11. That said, which Java runtime Tomcat actually uses at runtime depends entirely on what the user has configured as the system default JRE. Additionally, starting with the release of Tomcat 10, a startup script will run before Tomcat launches to automatically locate a suitable JRE if none has been explicitly configured.