IllegalArgumentException with Spark collect() on Jupyter

大憨熊 提交于 2019-12-04 09:48:04

For those of you having the same problem, there seems to be an issue with Spark (as of version 2.2.1) and Java 9. I got my example code to work by setting JAVA_HOME back to Java 1.8.

I had the same issue when loading text files. Apache Spark does not work with Java >= 9 yet. Switch back to Java 8. Remove your current Java SDK with these commands:

sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin 
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane 
sudo rm -fr ~/Library/Application\ Support/Java
sudo rm -fr /Library/Java/JavaVirtualMachines/jdkmajor.minor.macro[_update].jdk(your version here)

Then download JAVA SDK 8 and install it. You should be good.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!