Cassandra 3.0 and later require Java 8u40 or later

I am trying to run cassandra 3.0 in datastax. But I get an error stating that Cassandra 3.0 and later require Java 8u40 or later.

I installed java and moved jdk1.8.0_65 to /usr/local/java and set JAVA_HOME to /usr/local/java/jdk1.8.0_65 .

But I still encounter the following error:

Cassandra 3.0 and later require Java 8u40 or later.

+9
cassandra java-home
source share
10 answers

I installed Cassandra 3.2 DataStax Distribution rpm on CentOS 7 and experienced the same problem. Cassandra startup script /etc/rc.d/init.d/cassandra finds java binary only in a predefined list of paths.

JVM_SEARCH_DIRS="/usr/lib/jvm/jre /usr/lib/jvm/jre-1.7.* /usr/lib/jvm/java-1.7.*/jre"

If your java binary is /usr/jdk64/jdk1.8.0_60/jre/bin/java , add /usr/jdk64/jdk1.8.0_60/jre to JVM_SEARCH_DIRS or create a symbolic link /usr/lib/jvm/jre for /usr/jdk64/jdk1.8.0_60/jre .

+5
source share

Check java version. if your java version is "1.8.0_40" later. browse to this file apache-cassandra-3.7 \ conf \ cassandra-env.ps1 and find this word JVM_VERSION.CompareTo ("1.8.0_40"), then change it to your version. For example, if you are using java 1.8.0_102, then go to JVM_VERSION.CompareTo ("1.8.0_102").

Now, check out. He will work.

+3
source share

I usually solve this by adding my specific JAVA_HOME in the scripts $DSE_DIR/resources/cassandra/conf/cassandra.in.sh and $DSE_DIR/bin/dse.in.sh provided with DataStax .
Add: JAVA_HOME=/usr/local/java/jdk1.8.0_65 in each. (Or a symlink if you want to be able to exchange JVMs without editing these files again.)

+2
source share

The following works for me on the RHEL system:

 yum install java-1.8.0-openjdk
 ln -nfs /usr/lib/jvm/jre-1.8.0-openjdk.x86_64 / etc / alternatives / jre
 ln -nfs /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java / etc / alternatives / java
+2
source share
  • Check the first version of java with this java -version
  • Check java path with this command echo $JAVA_HOME
+1
source share

I have the same problem too. My solution is to edit the apache-cassandra-3.7 / bin / cassandra file. Below the line containing "#! / Bin / sh" (2nd line), you can put the line as shown below

 JAVA_HOME="/path/of/your/jdk" 

example:

 JAVA_HOME="/opt/jdk1.8.0_101" 

We hope that this solution will help you and other people.

+1
source share

Use the following commands.

 sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer 
0
source share

nodetool can still access an earlier version of Java, I also ran into the same problem.

do it short

sudo vim /etc/environment add this line JAVA_HOME = "/ USR / Library / JVM / Java-8-oracle / JRE / bin / Java"

source /etc/environment

echo $JAVA_HOME

nodetool status

make it longer

Follow the instructions here to install and change the version of java installed on your system. His explanation is very good.

0
source share

Try using the alternatives command:

 $ nodetool Cassandra 3.0 and later require Java 8u40 or later. $ java -version java version "1.7.0_151" $ sudo yum install java-1.8.0-openjdk ... $ sudo alternatives --config java There are 2 programs which provide 'java'. Selection Command ----------------------------------------------- *+ 1 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java 2 /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java Enter to keep the current selection[+], or type selection number: 2 $ java -version openjdk version "1.8.0_151" OpenJDK Runtime Environment (build 1.8.0_151-b12) OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode) $ nodetool usage: nodetool [(-p <port> | --port <port>)] [(-pwf <passwordFilePath> | --password-file <passwordFilePath>)] [(-h <host> | --host <host>)] [(-u <username> | --username <username>)] [(-pw <password> | --password <password>)] <command> [<args>] 
0
source share

It seems as though the cassandra service will only select the Java version from alternatives .

 sudo alternatives --config java 

... do not choose Java 9 there.

 sudo service cassandra start 

/etc/cassandra/default.conf/jvm.options has additional JVM options.

0
source share

All Articles