Ensime scala errors (class scala.Array not found, scala not found)

I installed ensime according to the README.md file, however I get errors in the junior-ensime server buffer with the following:

  INFO: Fatal Error: scala.tools.nsc.MissingRequirementError: object scala not found.
 scala.tools.nsc.MissingRequirementError: object scala not found.
     at scala.tools.nsc.symtab.Definitions $ definitions $ .getModuleOrClass (Definitions.scala: 516)
     at scala.tools.nsc.symtab.Definitions $ definitions $ .ScalaPackage (Definitions.scala: 43)
     at scala.tools.nsc.symtab.Definitions $ definitions $ .ScalaPackageClass (Definitions.scala: 44)
     at scala.tools.nsc.symtab.Definitions $ definitions $ .UnitClass (Definitions.scala: 89)
     at scala.tools.nsc.symtab.Definitions $ definitions $ .init (Definitions.scala: 786)
     at scala.tools.nsc.Global $ Run. (Global.scala: 593)
     at scala.tools.nsc.interactive.Global $ TyperRun. (Global.scala: 473)
     at scala.tools.nsc.interactive.Global.newTyperRun (Global.scala: 535)
     at scala.tools.nsc.interactive.Global.reloadSources (Global.scala: 289)
     at scala.tools.nsc.interactive.Global $$ anonfun $ reload $ 1.apply (Global.scala: 300)
     at scala.tools.nsc.interactive.Global $$ anonfun $ reload $ 1.apply (Global.scala: 300)
     at scala.tools.nsc.interactive.Global.respond (Global.scala: 276)
     at scala.tools.nsc.interactive.Global.reload (Global.scala: 300)
     at scala.tools.nsc.interactive.CompilerControl $$ anon $ 1.apply $ mcV $ sp (CompilerControl.scala: 81)
     at scala.tools.nsc.interactive.Global.pollForWork (Global.scala: 132)
     at scala.tools.nsc.interactive.Global $$ anon $ 2.run (Global.scala: 192)

and

  INFO: Fatal Error: scala.tools.nsc.MissingRequirementError: class scala.Array not found.
 scala.tools.nsc.MissingRequirementError: class scala.Array not found.
     at scala.tools.nsc.symtab.Definitions $ definitions $ .getModuleOrClass (Definitions.scala: 516)
     at scala.tools.nsc.symtab.Definitions $ definitions $ .getClass (Definitions.scala: 474)
     at scala.tools.nsc.symtab.Definitions $ definitions $ .ArrayClass (Definitions.scala: 217)
     at scala.tools.nsc.backend.icode.TypeKinds $ REFERENCE. (TypeKinds.scala: 258)
     at scala.tools.nsc.backend.icode.GenICode $ ICodePhase. (GenICode.scala: 55)
     at scala.tools.nsc.backend.icode.GenICode.newPhase (GenICode.scala: 43)
     at scala.tools.nsc.backend.icode.GenICode.newPhase (GenICode.scala: 25)
     at scala.tools.nsc.Global $ Run $$ anonfun $ 4.apply (Global.scala: 606)
     at scala.tools.nsc.Global $ Run $$ anonfun $ 4.apply (Global.scala: 605)
     at scala.collection.LinearSeqOptimized $ class.foreach (LinearSeqOptimized.scala: 62)
     at scala.collection.immutable.List.foreach (List.scala: 46)
     at scala.tools.nsc.Global $ Run. (Global.scala: 605)
     at scala.tools.nsc.interactive.Global $ TyperRun. (Global.scala: 473)
     at scala.tools.nsc.interactive.Global.newTyperRun (Global.scala: 535)
     at scala.tools.nsc.interactive.Global.reloadSources (Global.scala: 289)
     at scala.tools.nsc.interactive.Global.typedTreeAt (Global.scala: 309)
     at scala.tools.nsc.interactive.Global $$ anonfun $ getTypedTreeAt $ 1.apply (Global.scala: 326)
     at scala.tools.nsc.interactive.Global $$ anonfun $ getTypedTreeAt $ 1.apply (Global.scala: 326)
     at scala.tools.nsc.interactive.Global.respond (Global.scala: 276)
     at scala.tools.nsc.interactive.Global.getTypedTreeAt (Global.scala: 326)
     at scala.tools.nsc.interactive.CompilerControl $$ anon $ 2.apply $ mcV $ sp (CompilerControl.scala: 89)
     at scala.tools.nsc.interactive.Global.pollForWork (Global.scala: 132)
     at scala.tools.nsc.interactive.Global $$ anon $ 2.run (Global.scala: 192)

And none of the type identifiers work for me, I get "NA" if I get anything at all. Cc t causes emacs to block.

I run:

Ubuntu 10.04 (64-bit)
emacs 23.1.50.1
ensime from git (as of May 3, 2010)
scala - version 2.8.0.RC1
java - 1.6.0_20 (from the sun)
here is a copy of the magazine: http://dl.dropbox.com/u/5309017/ensime.log

Thanks!
Jeff

+4
source share
1 answer

"scala.tools.nsc.MissingRequirementError: object scala not found" usually means that the standard scala libarary cannot be found. Look at the bottom buffer of the ensime server and it should print the classpath used. Here is an excerpt from mine:

INFO: [Classpath = / usr / lib / jvm / java-6-openjdk / jre / lib / resources.jar: /usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar: / usr / lib / jvm / java-6-openjdk / jre / lib / jsse.jar: /usr/lib/jvm/java-6-openjdk/jre/lib/jce.jar: / usr / lib / jvm / java -6- OpenJDK / JRE / Library / charsets.jar: /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar: / USR / Library / JVM / Java-6-OpenJDK / JRE / Library / ext / dnsns.jar: /usr/lib/jvm/java-6-openjdk/jre/lib/ext/pulse-java.jar: / usr / lib / jvm / java-6-openjdk / jre / lib / ext / sunjce_provider. jar: /usr/lib/jvm/java-6-openjdk/jre/lib/ext/sunpkcs11.jar: /usr/lib/jvm/java-6-openjdk/jre/lib/ext/localedata.jar: / usr /lib/jvm/java-6-openjdk/jre/lib/ext/gnome-java-bridge.jar:/home/aemon/src/misc/ensime/lib/jnotify/jnotify-0.93.jar:/home/aemon / Src / misc / ensime / Library / scala / scala-library.jar: /home/aemon/src/misc/ensime/lib/scala/scala-compiler.jar]

Check out scala -library.jar, the second from the end. You may need to modify the .ensime file so that the: classpath field points to the library jar.

+5
source

Source: https://habr.com/ru/post/1308787/


All Articles