Cassandra: Unable to find java executable
Asked Answered
K

3

5

I am starting to learn cassandra and downloaded the file from the Apache Cassandra. When I navigated through the bin folder of the apache-cassandra-2.2.1/bin and run the command cassandra it gives me the error saying Unable to find java executable. Check JAVA_HOME and PATH environment variables.

But at the same path when I hit java I am able to see the java is accessible there. What should I do to get rid of this? I am using Windows OS.

Edit: I rather used Datastax windows installer and now I see no error in running cqlsh.

Kamilahkamillah answered 13/9, 2015 at 2:30 Comment(1)
I have never installed on windows, but see this, "I generally create an environment variable JAVA_HOME which points to java jdk and CASSANDRA_HOME which points to the root directory of Cassandra as shown above in the screen shot." from: varunpant.com/posts/install-apache-cassandraCriminology
A
7

I was also facing the same problem. Actually, somewhere in installation scripts it adds "bin/java" to "$JAVA_HOME". In my case, java path was "/usr/bin/java" so I had to configure $JAVA_HOME=/user.

export JAVA_HOME=/usr/
Aristotelian answered 6/9, 2016 at 16:54 Comment(0)
C
0

Set JAVA_HOME:

Right click My Computer and select Properties.

On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1.6.0_02.

FROM: http://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/index.html

Criminology answered 13/9, 2015 at 11:0 Comment(2)
You set both java_home and cassandra_home?Criminology
Yes but no luck. I installed Datastax community using planetcassandra.org/cassandra and now all works fine. just downloading tar.gz did not work well.Kamilahkamillah
H
0
  1. login with root because Cassandra will start with the root
  2. readlink -f $(which java)
  3. vi ~/.bashrc
  4. source ~/.bashrc

please note: java version should be same on cluster nodes

BR// nitin.k

Hilde answered 6/4, 2022 at 6:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.