用以下写法即可!
Configuration conf = new Configuration();
conf.addResource(new File("/etc/hadoop/conf/core-site.xml").toURI().toURL());
用以下写法即可!
Configuration conf = new Configuration();
conf.addResource(new File("/etc/hadoop/conf/core-site.xml").toURI().toURL());