Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Cassandra to use an alternate Java install

Tags:

java

cassandra

I'm working on getting a Cassandra instance up and running, but i'm having issues telling Cassandra which Java installation to use. The situation is as follows:

The server has Java 6 installed, and all Java environment variables are pointed to this installation ($JAVA_HOME, etc). This installation is what every other program on the server utilizes right now.

Java 7 is also installed, in a separate location, but is not the version used by default.

I've attempted to dig into the cassandra-env.sh script in $CASS_HOME/conf and the cassandra script in $CASS_HOME/bin, but I haven't had much luck finding a place to specify a different $JAVA_HOME directory. Does anyone have experience with doing this sort of thing with Cassandra?

like image 764
Chris C Avatar asked Dec 24 '22 07:12

Chris C


1 Answers

I did finally find this setting:

In the $CASSANDRA_HOME/bin dir, there is a file called cassandra.in.sh, there is a section that looks like this:

   # JAVA_HOME can optionally be set here
   JAVA_HOME=/usr/local/jdk6

You can modify this to have Cassandra use a different Java installation.

like image 191
Chris C Avatar answered Dec 29 '22 00:12

Chris C