使用Maven编译Scala时报:bad symbolic reference. A signature in package.class refers to type compileTimeOnly

在使用maven编译scala的时候,报错:

    Error:scalac: bad symbolic reference. A signature in package.class refers to type compileTimeOnly
    in package scala.annotation which is not available.
    It may be completely missing from the current classpath, or the version on

    the classpath might be incompatible with the version used when compiling package.class.


原因:在pom.xml中缺少scala的相关依赖

解决:加入scala相关依赖即可。

<dependency>
    <groupId>org.scala-langgroupId>
    <artifactId>scala-libraryartifactId>
    <version>2.10.6version>
dependency>
<dependency>
    <groupId>org.scala-langgroupId>
    <artifactId>scala-compilerartifactId>
    <version>2.10.6version>
dependency>

你可能感兴趣的:(Spark)