使用Idea创建Scala项目报错scalac: Error: Error compiling the sbt component ‘compiler-interface-2.10.0-52.0‘

错误日志:

scalac: Error: Error compiling the sbt component 'compiler-interface-2.10.0-52.0'
sbt.internal.inc.CompileFailed: Error compiling the sbt component 'compiler-interface-2.10.0-52.0'
    at sbt.internal.inc.AnalyzingCompiler$.handleCompilationError$1(AnalyzingCompiler.scala:424)
    at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$5(AnalyzingCompiler.scala:441)
    at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$5$adapted(AnalyzingCompiler.scala:436)
    at sbt.io.IO$.withTemporaryDirectory(IO.scala:490)
    at sbt.io.IO$.withTemporaryDirectory(IO.scala:500)
    at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$2(AnalyzingCompiler.scala:436)
    at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$2$adapted(AnalyzingCompiler.scala:428)
    at sbt.io.IO$.withTemporaryDirectory(IO.scala:490)
    at sbt.io.IO$.withTemporaryDirectory(IO.scala:500)
    at sbt.internal.inc.AnalyzingCompiler$.compileSources(AnalyzingCompiler.scala:428)
    at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl$.org$jetbrains$jps$incremental$scala$local$CompilerFactoryImpl$$getOrCompileInterfaceJar(CompilerFactoryImpl.scala:154)
    at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl.$anonfun$getScalac$1(CompilerFactoryImpl.scala:54)
    at scala.Option.map(Option.scala:242)
    at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl.getScalac(CompilerFactoryImpl.scala:47)
    at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl.createCompiler(CompilerFactoryImpl.scala:25)
    at org.jetbrains.jps.incremental.scala.local.CachingFactory.$anonfun$createCompiler$3(CachingFactory.scala:24)
    at org.jetbrains.jps.incremental.scala.local.Cache.$anonfun$getOrUpdate$2(Cache.scala:20)
    at scala.Option.getOrElse(Option.scala:201)
    at org.jetbrains.jps.incremental.scala.local.Cache.getOrUpdate(Cache.scala:19)
    at org.jetbrains.jps.incremental.scala.local.CachingFactory.createCompiler(CachingFactory.scala:24)
    at org.jetbrains.jps.incremental.scala.local.LocalServer.doCompile(LocalServer.scala:43)
    at org.jetbrains.jps.incremental.scala.local.LocalServer.compile(LocalServer.scala:30)
    at org.jetbrains.jps.incremental.scala.remote.Main$.compileLogic(Main.scala:207)
    at org.jetbrains.jps.incremental.scala.remote.Main$.$anonfun$handleCommand$1(Main.scala:190)
    at org.jetbrains.jps.incremental.scala.remote.Main$.decorated$1(Main.scala:180)
    at org.jetbrains.jps.incremental.scala.remote.Main$.handleCommand(Main.scala:187)
    at org.jetbrains.jps.incremental.scala.remote.Main$.serverLogic(Main.scala:163)
    at org.jetbrains.jps.incremental.scala.remote.Main$.nailMain(Main.scala:103)
    at org.jetbrains.jps.incremental.scala.remote.Main.nailMain(Main.scala)
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.martiansoftware.nailgun.NGSession.run(NGSession.java:319)

问题原因:pom.xml中配置scala.version与本地安装Scala版本不一致,本地安装为:2.12.15

解决方案:替换版本号

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值