cassandra 2 complaining about Java 7 when I have Java 7 installed

前端 未结 8 932
不思量自难忘°
不思量自难忘° 2021-01-22 09:26
$ cassandra 
Cassandra 2.0 and later require Java 7 or later.

OK, what\'s going on in that part of the init script?

java_ver_output=`\         


        
相关标签:
8条回答
  • 2021-01-22 10:18

    I got the same error message when trying to start Cassandra. But I notised that I only got the error when starting Cassandra as root. It worked when I started Cassandra as my local user.

    It turned out that java only was configured for my local user:

    $ java -version
    java version "1.7.0_60"
    Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
    Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)
    $ sudo java -version
    sudo: java: command not found
    

    This fixed the problem:

    Tell the system that you have JRE installed (update usr/local/java/jre1.7.0_60/bin/java to your current path):

    $ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jre1.7.0_60/bin/java" 1
    

    Set the new JRE as default:

    $ sudo update-alternatives --set java /usr/local/java/jre1.7.0_60/bin/java
    

    Now java is installed for root and Cassandra can be started as root without the error message.

    0 讨论(0)
  • 2021-01-22 10:23

    Per documentation: http://wiki.helioviewer.org/wiki/Apache_Cassandra_Installation

    Set JAVA_HOME

    Make sure JAVA_HOME is set: echo $JAVA_HOME

    So make sure JAVA_HOME is pointing to /path/to/jdk7

    0 讨论(0)
提交回复
热议问题