引起:java.lang.UnsatisfiedLinkError:org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z
我在尝试将 txt 文件写入 Windows 中的本地路径时收到此错误。
错误: 引起:java.lang.UnsatisfiedLinkError:org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z
- Spark,hadoop版本:spark-3.0.3-bin-hadoop2.7 。
- winutils 放置在 C:\winutils\bin
- hadoop.dll 放置在 C:\winutils\bin 并
- 设置 c:\System32 环境变量 HADOOP_HOME C:\winutils 路径 %HADOOP_HOME%\bin
- 尝试重新启动
I am getting this error while trying to write txt file to local path in windows.
Error:
Caused by: java.lang.UnsatisfiedLinkError: org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z
- Spark , hadoop versions : spark-3.0.3-bin-hadoop2.7.
- winutils is placed in C:\winutils\bin
- hadoop.dll is placed in C:\winutils\bin and c:\System32
- Environment Variables set
HADOOP_HOME C:\winutils
Path %HADOOP_HOME%\bin - Tried restarting
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了以下原因和解决方案:
根本原因:
Gradle 依赖于较高版本的 Spark。我安装了spark 3.0.3,但这里是3.2.0
实现“org.apache.spark:spark-core_2.13:3.2.0”
修复:
替换为
实现“org.apache.spark:spark-core_2.12:3.0.3”
I found below cause and solution:
Root Cause:
Gradle dependency was with higher version of spark. I have spark 3.0.3 installed but here it was 3.2.0
implementation 'org.apache.spark:spark-core_2.13:3.2.0'
Fix:
Replaced with
implementation 'org.apache.spark:spark-core_2.12:3.0.3'