(run-main-0) java.lang.NoSuchMethodError

孤街浪徒 提交于 2019-11-28 22:56:15

I met with the same error when I used scala-library-2.11 jar But when I replaced it with scala-library-2.10 jar . It runs fine

It is probably caused by using incompatible versions of Scala. When I downgraded from Scala 2.11 to 2.10, I forgot to modify one package version (so one package used 2.11, the rest 2.10), resulting in having the same error.

Note: I only had this problem when using IntelliJ.

If you are getting the error and here because you cannot run Jupiter notebooks with Spark 2.1 and Scala 2.11 below is how I was able to make it work. Assumes you installed Jupiter and toree

Pre-req - Make sure Docker is running else Make fails. Make sure gpg is installed else Make fails.

Build steps -

export SPARK_HOME=/Users/<path>/spark-2.1.0-hadoop2.7/ 
git clone https://github.com/apache/incubator-toree.git 
cd incubator-toree 
make clean release APACHE_SPARK_VERSION=2.1.0 
pip install --upgrade ./dist/toree-pip/toree-0.2.0.dev1.tar.gz 
pip freeze |grep toree 
jupyter toree install --spark_home=$SPARK_HOME

========================================================================

To Start the notebook - SPARK_OPTS='--master=local[4]' jupyter notebook

I used these versions and everything works now.

    <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-library</artifactId>
        <version>2.11.6</version>
    </dependency>

    <dependency>
        <groupId>com.typesafe.akka</groupId>
        <artifactId>akka-actor_2.11</artifactId>
        <version>2.3.11</version>
    </dependency>
Zhi Zheng

Check whether the scala version you are using corresponds to the precompiled spark version.

The issue could be reproduced with version 2.11.8.

By the moment, no downgrade is required. Just update scala-library version to 2.12.0.

I've the exactly the same problem and got it fixed by downgrading scala 2.11.8 to 2.10.6.

Willem Bressers

I've the same issue but where do i alter the scala-library version?

Installation (on Ubuntu 16.04):

sudo apt-get install oracle-java8-installer
wget http://d3kbcqa49mib13.cloudfront.net/spark-2.0.2-bin-hadoop2.7.tgz && tar xvf spark-2.0.2-bin-hadoop2.7.tgz
pip install toree && jupyter toree install

So when I start with a notebook it tells me that I use a different scala version. But I haven't installed anything else. screenshot + scala version

My spark jars folder contains an scala-library-2.11.8.jar file. But how tell torree to use that (or another) file for scala.

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