在~/.profile 中增加环境变量JAVA_HOME 设置: export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/ export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/ 验证变量配置: $ source ~/.profile $ echo $JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/ $ source ~/.profile $ echo $JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/ 显示已经配置成功了,然后执行Hadoop的启动脚本:start-dfs.sh ,启动正常后查看相关进程 ps -ef|grep hadoop,发现启动的......