2014-12-30 98 views
0

沒有augmentString方法我在Fedora 21:SBT編譯錯誤:在StringOps

  • 斯卡拉2.10.3
  • 的Java 1.8.0
  • SBT 0.13.1

使用yum安裝了ScalajavaSbt手動安裝並且在~/.bashrc文件末尾添加行export PATH=/home/igor/Documents/Projects/Scala/Assignments/sbt/bin:$PATH以使sbt在終端中可用。然後,當我的CD到/home/igor/Documents/Projects/Scala/Assignments/example和運行sbt -h,通常顯示的幫助信息,但如果開始SBT:

[[email protected] example]$ sbt 
Loading /home/igor/Documents/Projects/Scala/Assignments/sbt/bin/sbt-launch-lib.bash 
OpenJDK Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0 
java.lang.NoSuchMethodError: scala.Predef$.augmentString(Ljava/lang/String;)Lscala/collection/immutable/StringOps; 
    at sbt.ConsoleLogger$.<init>(ConsoleLogger.scala:129) 
    at sbt.ConsoleLogger$.<clinit>(ConsoleLogger.scala) 
    at sbt.StandardMain$.<init>(Main.scala:52) 
    at sbt.StandardMain$.<clinit>(Main.scala) 
    at sbt.xMain.run(Main.scala:26) 
    at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:57) 
    at xsbt.boot.Launch$.withContextLoader(Launch.scala:77) 
    at xsbt.boot.Launch$.run(Launch.scala:57) 
    at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:45) 
    at xsbt.boot.Launch$.launch(Launch.scala:65) 
    at xsbt.boot.Launch$.apply(Launch.scala:16) 
    at xsbt.boot.Boot$.runImpl(Boot.scala:32) 
    at xsbt.boot.Boot$.main(Boot.scala:21) 
    at xsbt.boot.Boot.main(Boot.scala) 
Error during sbt execution: java.lang.NoSuchMethodError: scala.Predef$.augmentString(Ljava/lang/String;)Lscala/collection/immutable/StringOps; 

如果我下載scala 2.10.4yum remove scala和新斯卡拉添加到路徑就像我與SBT手工做的,同樣的錯誤依然存在。

是否有可能使sbt工作?我需要運行sbt submit命令才能將作業提交給Coursera。

+0

「java.lang.NoSuchMethodError:scala.Predef $ .augmentString」大部分時間由於依賴jar版本不匹配而發生此錯誤。確保你的路徑中有正確的jar版本。 – kosa

回答

1

不知道,但它可能是一個問題與Java 8 從類型安全blog斯卡拉2.11

The Scala 2.11 series targets Java 6, with (evolving) experimental support for Java 8. In 2.11, Java 8 support is mostly limited to reading Java 8 bytecode and parsing Java 8 source. We will be expanding Scala's (experimental) Java 8 support and interop throughout the 2.11 series.

如果2.11版本只有實驗性支持,那麼2.10也將不會有一個適當的支持Java 8.你可以做java 7的課程。這是一個真棒課程順便說一句:)

+1

我將這些行添加到'.bashrc'文件中: export PATH =/home/igor/Documents/Projects/Scala/Assignments/sbt/bin:$ PATH export PATH =/home/igor/Documents/Projects/Scala/Assignments/jdk1.7.0_72/bin:$ PATH export PATH =/home/igor/Documents/Projects/Scala/Assignments/jdk1.7.0_72/jre/bin:$ PATH export JAVA_HOME =/home/igor/Documents/Projects/Scala/Assignments/jdk1.7.0_72 export JRE_HOME =/home/igor/Documents/Projects/Scala/Assignments/jdk1.7.0_72/jre export PATH =/home/igor/Documents/Projects/Scala /分配/斯卡拉-2.10.4/bin中:$ PATH'。 這種方式java 1.8被忽略,java 1.7被sbt使用。 –