I’m just playing around with hbase( on EC2) and am having a problem when I launch it. Here’s what I get:
[root@domU-12-31-39-13-D6-62 ~]# sudo /etc/init.d/hadoop-hbase-master start
+======================================================================+
| Error: JAVA_HOME is not set and Java could not be found |
+----------------------------------------------------------------------+
| Please download the latest Sun JDK from the Sun Java web site |
| > http://java.sun.com/javase/downloads/ < |
| |
| HBase requires Java 1.6 or later. |
| NOTE: This script will find Sun Java whether you install using the |
| binary or the RPM based installer. |
+======================================================================+
I looked up the error and installed openjdk 1.6 and set the java_home variable in my .bash_profile and in /etc/profile(just in case hbase is running as a different user). It seems to have taken effect:
[root@domU-12-31-39-13-D6-62 ~]# java -version
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.4) (rhel-1.42.1.10.4.el6_2-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)
[root@domU-12-31-39-13-D6-62 ~]# echo $JAVA_HOME
/usr/bin/java
but I still get this error when launching hbase. I’m not that famlair with java so I’m not sure what I’m doing wrong. If it helps, I’m using centos6 on ec2 and cloudera’s repository for the hbase/hadoop packages.
JAVA_HOMEshouldn’t point to thejavaexecutable ‘, but rather to the place where the rest of the java files can be found.I think it’s
/usr/lib/jvm/jre-1.6.0-openjdk.x86_64/. IThink you can use
update-alternatives --display javato show all javas installed.