How do I install Cassandra 4 RPM package when only Java 11 is installed?

703 Views Asked by At

Cassandra 4 should work with java 11, but when I try to install it without java 8 then the installation fails:

error: Failed dependencies:
    jre >= 1.8.0 is needed by cassandra-4.0.4-1.noarch

How can I get around this? My current workaround is to install both java 8 and java 11, that way I satisfy the dependency requirement and can run cassandra 4 with java 11. However, there must surly be a better way? I would of course prefer to only have java 11 installed.

Some extra info:

I use CentOs 7 and RHEL 8

Cassandra rpm downloaded from https://downloads.apache.org/cassandra/redhat/40x/

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

There are 1 best solutions below

0
On BEST ANSWER

Since JRE is no longer available in Java 11 (JDK 11 release notes):

In this release, the JRE or Server JRE is no longer offered. Only the JDK is offered.

we probably shouldn't require the JRE as a dependency on CentOS and RHEL platforms:

Requires:      jre >= 1.8.0

As a workaround, you can override the dependency check when installing the RPM with the --nodeps option. For example:

$ sudo rpm --nodeps -i cassandra-4.0.4-1.noarch.rpm 

In the meantime, I've logged CASSANDRA-17669 for resolution. Cheers!