错误信息
Exception in thread "main" java.lang.UnsatisfiedlinkError: org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z at org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Native Method) at org.apache.hadoop.io.nativeio.NativeIO$Windows.access(NativeIO.java:640) at org.apache.hadoop.fs.FileUtil.canRead(FileUtil.java:1201) at org.apache.hadoop.fs.FileUtil.list(FileUtil.java:1406) at org.apache.hadoop.fs.RawLocalFileSystem.listStatus(RawLocalFileSystem.java:468) at org.apache.hadoop.fs.FileSystem.listStatus(FileSystem.java:1919) at org.apache.hadoop.fs.FileSystem.listStatus(FileSystem.java:1961) at org.apache.hadoop.fs.FileSystem$4.(FileSystem.java:2123) at org.apache.hadoop.fs.FileSystem.listLocatedStatus(FileSystem.java:2122) at org.apache.hadoop.fs.ChecksumFileSystem.listLocatedStatus(ChecksumFileSystem.java:693) at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.singleThreadedListStatus(FileInputFormat.java:310) at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.listStatus(FileInputFormat.java:272) at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.getSplits(FileInputFormat.java:394) at org.apache.hadoop.mapreduce.JobSubmitter.writeNewSplits(JobSubmitter.java:313) at org.apache.hadoop.mapreduce.JobSubmitter.writeSplits(JobSubmitter.java:330) at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:203) at org.apache.hadoop.mapreduce.Job$11.run(Job.java:1570) at org.apache.hadoop.mapreduce.Job$11.run(Job.java:1567) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1682) at org.apache.hadoop.mapreduce.Job.submit(Job.java:1567) at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1588) at com.henry.mapreduce.wordcount.WordCountDriver.main(WordCountDriver.java:38)
解决办法1:
将windows下hadoop的/bin/hadoop.dll文件复制到C:WindowsSystem32,但未能解决问题
解决办法2:
idea中双击shift搜索NativeIO,并拷贝到自己工程目录下,搜索access0,将返回值改为true