incubator-cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Huang Stanley <wenlien1...@gmail.com>
Subject I got an error message when I ran Cassandra 0.8.0-beta1 on Ubuntu.
Date Wed, 04 May 2011 02:34:31 GMT
Hi All:
When I try to run Cassandra 0.8.0-beta1 on Ubuntu, I got an error message.

./../conf/cassandra-env.sh: 99: [[: not found

Then I check the source as below:
---------------------------------------------------------------------------------------------------------------
java_version=`java -version 2>&1`
if [[ $java_version != *OpenJDK* ]]
then
    JVM_OPTS="$JVM_OPTS -javaagent:$CASSANDRA_HOME/lib/jamm-0.2.1.jar"
fi
---------------------------------------------------------------------------------------------------------------

At the mean while, I ran it with debug mode and got the following message
---------------------------------------------------------------------------------------------------------------
java_version=`java -version 2>&1`
+ java -version
+ java_version=java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.7) (6b20-1.9.7-0ubuntu1~10.04.1)
OpenJDK Server VM (build 19.0-b09, mixed mode)
if [[ $java_version != *OpenJDK* ]]
then
    JVM_OPTS="$JVM_OPTS -javaagent:$CASSANDRA_HOME/lib/jamm-0.2.1.jar"
fi
+ [[ java version "1.6.0_20" OpenJDK Runtime Environment (IcedTea6 1.9.7)
(6b20-1.9.7-0ubuntu1~10.04.1) OpenJDK Server VM (build 19.0-b09, mixed mode)
!= *OpenJDK* ]]
./cassandra-env.sh: 1: [[: not found
---------------------------------------------------------------------------------------------------------------

I think this section of codes might want to check java version but get an
error.
Therefore, I recommended to change this code to:
---------------------------------------------------------------------------------------------------------------
[ `java -version 2>&1 | grep -c OpenJDK` -gt 0 ] && isOpenJDK=1 ||
isOpenJDK=0
if [ $isOpenJDK -eq 1 ]
then
    JVM_OPTS="$JVM_OPTS -javaagent:$CASSANDRA_HOME/lib/jamm-0.2.1.jar"
fi
---------------------------------------------------------------------------------------------------------------

regards,

Stanley Huang

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message