Install Java 8 on Debian 10
Cassandra 3.11 does not work on Java 11, but Debian 10 has OpenJdk 11 installed as default.
Problem
When following the instructions of the Cassandra installation, nodetool status outputs the exception:
Reason
Cassandra 3.11 does not support Java 11. Java 11 support is implemented in Cassandra 4.
Solution
Install Java 8 alongside Java 11 since Cassandra 4 has not been released yet. Then config nodetool to use Java 8.
Install Java 8
Add a
contribcomponent to/etc/apt/sources.list, for example:# Debian 8 "Jessie"deb http://httpredir.debian.org/debian/ jessie main contribUpdate the list of available packages and install the java-package package:
# apt-get update && apt-get install java-package && exitDownload the desired Java JDK/JRE binary distribution from Oracle.
Use java-package to create a Debian package, for example:
$ make-jpkg jdk-8u51-linux-x64.tar.gzInstall the binary package created:
$ su# dpkg -i oracle-java8-jdk_8u51_amd64.deb
Config nodetool
- Locate the file
/usr/bin/nodetool. - Run
sudo vi nodetool. - Add
JAVA_HOME="/usr/lib/jvm/oracle-java8-server-jre-amd64"at the very beginning of the file.
Done
nodetool status should work now.
Configuration on system level
To use a specific version of Java