1.下载hadoop-common-2.2.0-bin并解压到某个目录
https://github.com/srccodes/hadoop-common-2.2.0-bin
2.设置hadoop.home.dir
System.setProperty("hadoop.home.dir", "D:\\hadoop-common-2.2.0-bin-master")
@SpringBootApplication public class Application { @PostConstruct void started() { TimeZone.setDefault(TimeZone.getTimeZone("UTC")); //TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai")); //TimeZone.setDefault(TimeZone.getTimeZone("GMT+8"));
System.setProperty("hadoop.home.dir", "/opt/software/hadoop-common-2.2.0-bin-master")
} public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
sprongboot 解决spark报错:Failed to locate the winutils binary in the hadoop binary path