• scala的hello world出现的问题


    build出现:

    Error:scalac: Error: org.jetbrains.jps.incremental.scala.remote.ServerException
    Error compiling sbt component 'compiler-interface-2.7.0-final-52.0'
    at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:145)
    at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:142)
    at sbt.IO$.withTemporaryDirectory(IO.scala:291)
    at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:142)
    at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:139)
    at sbt.IO$.withTemporaryDirectory(IO.scala:291)
    at sbt.compiler.AnalyzingCompiler$.compileSources(AnalyzingCompiler.scala:139)
    at sbt.compiler.IC$.compileInterfaceJar(IncrementalCompiler.scala:52)
    at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl$.getOrCompileInterfaceJar(CompilerFactoryImpl.scala:96)
    at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl$$anonfun$getScalac$1.apply(CompilerFactoryImpl.scala:50)
    at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl$$anonfun$getScalac$1.apply(CompilerFactoryImpl.scala:49)
    at scala.Option.map(Option.scala:146)
    at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl.getScalac(CompilerFactoryImpl.scala:49)
    at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl.createCompiler(CompilerFactoryImpl.scala:22)
    at org.jetbrains.jps.incremental.scala.local.CachingFactory$$anonfun$createCompiler$1.apply(CachingFactory.scala:24)
    at org.jetbrains.jps.incremental.scala.local.CachingFactory$$anonfun$createCompiler$1.apply(CachingFactory.scala:24)
    at org.jetbrains.jps.incremental.scala.local.Cache$$anonfun$getOrUpdate$2.apply(Cache.scala:20)
    at scala.Option.getOrElse(Option.scala:121)
    at org.jetbrains.jps.incremental.scala.local.Cache.getOrUpdate(Cache.scala:19)
    at org.jetbrains.jps.incremental.scala.local.CachingFactory.createCompiler(CachingFactory.scala:23)
    at org.jetbrains.jps.incremental.scala.local.LocalServer.compile(LocalServer.scala:22)
    at org.jetbrains.jps.incremental.scala.remote.Main$.make(Main.scala:68)
    at org.jetbrains.jps.incremental.scala.remote.Main$.nailMain(Main.scala:25)
    at org.jetbrains.jps.incremental.scala.remote.Main.nailMain(Main.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    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)

    导致右击main类也没有run 类名的选项

    baidu了有些是说由于java版本过低,我找到的原因是由于自己安装的scala sdk和新建project是的pom.xml的scala的版本不一致导致的问题。

    解决方案:

    You have to change the Version of scala in your pom.xml file from ${scala.version} to 2.11.4 (or whatever the newest version is)

    将pom.xml的scala.version的版本改为自己本机安装的版本即可。

  • 相关阅读:
    ZOJ3329One Person Game(循环型 数学期望)
    ZOJ3551Bloodsucker (数学期望)
    HDU3853LOOPS (师傅逃亡系列•三)(基础概率DP)
    HDU4035 Maze(师傅逃亡系列•二)(循环型 经典的数学期望)
    阿里云DataV专业版发布,为可视化创造更多可能!
    Logtail提升采集性能
    达摩院首席数据库科学家李飞飞:云原生新战场,我们如何把握先机?
    什么是最佳的视频用户体验?阿里云视频服务四大体验优化实践
    Lambda plus: 云上大数据解决方案
    基于大数据的舆情分析系统架构
  • 原文地址:https://www.cnblogs.com/antyi/p/7623396.html
Copyright © 2020-2023  润新知