1. 程式人生 > >Hdoop 啟動:localhost: Error: JAVA_HOME is not set and could not be found.

Hdoop 啟動:localhost: Error: JAVA_HOME is not set and could not be found.

其中有

Prepare to Start the Hadoop Cluster

Unpack the downloaded Hadoop distribution. In the distribution, edit
the file etc/hadoop/hadoop-env.sh to define some parameters as
follows:
export JAVA_HOME=/usr/java/latest(原來是${JAVA_HOME},把這個改為相應的jdk真實路勁)
Try the following command:
bin/hadoop


This will display the usage documentation for the
hadoop script.

自己不按照文件說的來,因為在shell指令碼中一般$${JAVA_HOME} 或者$JAVA_HOME
都是取變數的值,然後左邊又有=等號,所以就自作聰明的認為沒有必要了!
關於環境相關,以後還是就按照官方的來吧。。。。

現在還有極大的可能是,JAVA_HOME沒有被 export