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); } }

 

posted on 2020-05-07 21:26  lshan  阅读(307)  评论(0编辑  收藏  举报