【问题标题】:Eclipse IDE for Scala : symbol is missing from classpathEclipse IDE for Scala:类路径中缺少符号
【发布时间】:2017-10-06 12:01:05
【问题描述】:

当我在 Eclipse Oxygen (ubuntu 16.04) 中构建我的 Scala-Spark 项目时,它在“问题”控制台中返回了这个问题:

 Symbol 'term <none>.typesafe.scalalogging' is missing from the classpath. This symbol is required by 'trait org.graphframes.Logging'. Make sure that term scalalogging is in your classpath and check for conflicting dependencies with `-Ylog-classpath`. A full rebuild may help if 'Logging.class' was compiled against an incompatible version of <none>.typesafe. Example.scala   /FakeYelp/src/main/scala/bigdata/FakeYelp   line 18 Scala Problem

Symbol 'term com.typesafe' is missing from the classpath. This symbol is required by 'trait org.graphframes.Logging'. Make sure that term typesafe is in your classpath and check for conflicting dependencies with `-Ylog-classpath`. A full rebuild may help if 'Logging.class' was compiled against an incompatible version of com.  Example.scala   /FakeYelp/src/main/scala/bigdata/FakeYelp   line 18 Scala Problem

Symbol 'type <none>.slf4j.LazyLogging' is missing from the classpath. This symbol is required by 'trait org.graphframes.Logging'. Make sure that type LazyLogging is in your classpath and check for conflicting dependencies with `-Ylog-classpath`. A full rebuild may help if 'Logging.class' was compiled against an incompatible version of <none>.slf4j.  Example.scala   /FakeYelp/src/main/scala/bigdata/FakeYelp   line 18 Scala Problem

错误开启:

val gFrame = GraphFrame(vertexDF, edgeDF)

如何解决这个问题?

更新 这是我的 pom.xml Maven 配置:

<dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>


<!-- https://mvnrepository.com/artifact/graphframes/graphframes -->
<dependency>
    <groupId>graphframes</groupId>
    <artifactId>graphframes</artifactId>
    <version>0.5.0-spark2.1-s_2.11</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.spark/spark-core_2.10 -->
<dependency>
    <groupId>org.apache.spark</groupId>
    <artifactId>spark-core_2.10</artifactId>
    <version>2.1.1</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.spark/spark-sql_2.11 -->
<dependency>
    <groupId>org.apache.spark</groupId>
    <artifactId>spark-sql_2.11</artifactId>
    <version>2.1.1</version>
    <scope>provided</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.spark/spark-graphx_2.11 -->
<dependency>
    <groupId>org.apache.spark</groupId>
    <artifactId>spark-graphx_2.11</artifactId>
    <version>2.1.1</version>
    <scope>provided</scope>
</dependency>
</dependencies>

【问题讨论】:

  • 不适合我...
  • 您能否添加有关您的 build.sbt 和 plugins.sbt 的更多详细信息
  • 我使用 maven,我用 maven 配置更新了我的帖子

标签: eclipse scala apache-spark maven-plugin graphframes


【解决方案1】:

您不能同时使用..._2.10..._2.11。 Maven 不知道这些后缀是否有意义,因此无法提供有用的错误。添加一个属性并使用_${scala.binary} 一起切换依赖项(并确保它与您正在使用的Scala 版本相对应)。

可能还有其他问题,但这需要先解决。

【讨论】:

    猜你喜欢
    • 2021-12-09
    • 2021-10-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-01
    相关资源
    最近更新 更多