您可能想看看JAVA_HOME
和HADOOP_CLASSPATH
。在经历了一个痛苦的周日早晨之后,这个 conf(虽然可能是多余的)在 MacOS 上为我工作 :-) - 您需要根据您的机器、安装和操作系统进行所需的更改,但至少您有一个线索。
Sys.setenv ("JAVA_HOME"="/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre")
Sys.setenv ("HADOOP_PREFIX"="/usr/local/Cellar/hadoop/2.8.1")
Sys.setenv ("HADOOP_CMD"="/usr/local/Cellar/hadoop/2.8.1/bin/hadoop")
Sys.setenv ("HADOOP_STREAMING"="/usr/local/Cellar/hadoop/2.8.1/libexec/share/hadoop/tools/lib/hadoop-streaming-2.8.1.jar")
Sys.setenv ("HADOOP_CLASSPATH"="/usr/local/Cellar/hadoop/2.8.1/libexec/etc/hadoop:/usr/local/Cellar/hadoop/2.8.1/libexec/share/hadoop/common/lib/*:/usr/local/Cellar/hadoop/2.8.1/libexec/share/hadoop/common/*:/usr/local/Cellar/hadoop/2.8.1/libexec/share/hadoop/hdfs:/usr/local/Cellar/hadoop/2.8.1/libexec/share/hadoop/hdfs/lib/*:/usr/local/Cellar/hadoop/2.8.1/libexec/share/hadoop/hdfs/*:/usr/local/Cellar/hadoop/2.8.1/libexec/share/hadoop/yarn/lib/*:/usr/local/Cellar/hadoop/2.8.1/libexec/share/hadoop/yarn/*:/usr/local/Cellar/hadoop/2.8.1/libexec/share/hadoop/mapreduce/lib/*:/usr/local/Cellar/hadoop/2.8.1/libexec/share/hadoop/mapreduce/*:/contrib/capacity-scheduler/*.jar")