title: zookeeper Starting error :'JAVA_HOME error in zookeeper.out'
body: <p>When I do </p>
  
  <pre><code>bin/zkServer.sh start    #It shows it has started
  
  ZooKeeper JMX enabled by default
  Using config: /data/sparkHA/zookeeper-3.4.9/bin/../conf/zoo.cfg
  Starting zookeeper ... STARTED
  </code></pre>
  
  <p>Afetr few second when i check status, I got </p>
  
  <pre><code>ZooKeeper JMX enabled by default
  Using config: /data/sparkHA/zookeeper-3.4.9/bin/../conf/zoo.cfg
  Error contacting service. It is probably not running.
  </code></pre>
  
  <p>My zookeeper.out says</p>
  
  <pre><code>nohup: failed to run command â/usr/bin/java/bin/javaâ: Not a directory
  </code></pre>
  
  <p>But my JAVA_HOME in bashrc is usr/bin/java, How come one extra /bin/java is added , that results in an invalid directory.</p>
  
  <p>Also echo $JAVA_HOME outputs </p>
  
  <pre><code>/usr/bin/java
  </code></pre>
  
  <p>How to approach this error. Please Help. Thanks.</p>
  
  <p>Also tried setting JAVA_HOME in zkServer.sh also by following <a href="https://stackoverflow.com/questions/20791846/zookeeper-not-starting-nohup-error">Zookeeper not starting, nohup error</a> but getting same error.</p>