sbt版本:1.2.1 斯卡拉版本:2.12.6
我可以将Ensime与emacs连接,但是一旦运行C-C C-B c(ensime-sbt-do-compile(,然后遇到以下错误
[ERROR] Failed to construct terminal; falling back to unsupported
java.lang.IllegalArgumentException: Invalid terminal type:
at jline.TerminalFactory.create(TerminalFactory.java:103)
at jline.TerminalFactory.get(TerminalFactory.java:180)
at jline.TerminalFactory.get(TerminalFactory.java:186)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:244)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:236)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:228)
at sbt.internal.util.JLine$.$anonfun$createReader$1(LineReader.scala:137)
at sbt.internal.util.JLine$.$anonfun$usingTerminal$1(LineReader.scala:128)
at sbt.internal.util.JLine$.withTerminal(LineReader.scala:118)
at sbt.internal.util.JLine$.usingTerminal(LineReader.scala:126)
at sbt.internal.util.JLine$.createReader(LineReader.scala:136)
at sbt.internal.util.SimpleReader.<init>(LineReader.scala:213)
at sbt.internal.util.SimpleReader$.<init>(LineReader.scala:216)
at sbt.internal.util.SimpleReader$.<clinit>(LineReader.scala)
at sbt.Import.$init$(Import.scala:179)
at sbt.package$.<init>(package.scala:11)
at sbt.package$.<clinit>(package.scala)
at $0c1c090d12f59c194554$.$sbtdef(C:Usersxxx.sbt1.0pluginsbuild.sbt:1)
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 sbt.compiler.Eval$.getValue(Eval.scala:578)
at sbt.compiler.Eval.$anonfun$eval$1(Eval.scala:129)
at sbt.internal.EvaluateConfigurations$.$anonfun$evaluateDslEntry$1(EvaluateConfigurations.scala:249)
at sbt.internal.EvaluateConfigurations$.$anonfun$evaluateSbtFile$6(EvaluateConfigurations.scala:172)
at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
at scala.collection.immutable.List.foreach(List.scala:389)
at scala.collection.TraversableLike.map(TraversableLike.scala:234)
at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
at scala.collection.immutable.List.map(List.scala:295)
at sbt.internal.EvaluateConfigurations$.$anonfun$evaluateSbtFile$4(EvaluateConfigurations.scala:172)
at sbt.internal.Load$.loadSettingsFile$1(Load.scala:1137)
at sbt.internal.Load$.$anonfun$discoverProjects$2(Load.scala:1144)
at scala.collection.MapLike.getOrElse(MapLike.scala:128)
at scala.collection.MapLike.getOrElse$(MapLike.scala:126)
at scala.collection.AbstractMap.getOrElse(Map.scala:59)
at sbt.internal.Load$.memoLoadSettingsFile$1(Load.scala:1143)
at sbt.internal.Load$.$anonfun$discoverProjects$4(Load.scala:1151)
at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
at scala.collection.immutable.List.foreach(List.scala:389)
at scala.collection.TraversableLike.map(TraversableLike.scala:234)
at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
at scala.collection.immutable.List.map(List.scala:295)
at sbt.internal.Load$.loadFiles$1(Load.scala:1151)
at sbt.internal.Load$.discoverProjects(Load.scala:1165)
at sbt.internal.Load$.discover$1(Load.scala:862)
at sbt.internal.Load$.loadTransitive(Load.scala:937)
at sbt.internal.Load$.loadProjects$1(Load.scala:726)
at sbt.internal.Load$.$anonfun$loadUnit$11(Load.scala:729)
at sbt.internal.Load$.timed(Load.scala:1395)
at sbt.internal.Load$.$anonfun$loadUnit$1(Load.scala:729)
at sbt.internal.Load$.timed(Load.scala:1395)
at sbt.internal.Load$.loadUnit(Load.scala:688)
at sbt.internal.Load$.$anonfun$builtinLoader$4(Load.scala:484)
at sbt.internal.BuildLoader$.$anonfun$componentLoader$5(BuildLoader.scala:176)
at sbt.internal.BuildLoader.apply(BuildLoader.scala:241)
at sbt.internal.Load$.loadURI$1(Load.scala:546)
at sbt.internal.Load$.loadAll(Load.scala:562)
at sbt.internal.Load$.loadURI(Load.scala:492)
at sbt.internal.Load$.load(Load.scala:471)
at sbt.internal.Load$.$anonfun$apply$1(Load.scala:251)
at sbt.internal.Load$.timed(Load.scala:1395)
at sbt.internal.Load$.apply(Load.scala:251)
at sbt.internal.GlobalPlugin$.build(GlobalPlugin.scala:59)
at sbt.internal.GlobalPlugin$.load(GlobalPlugin.scala:64)
at sbt.internal.Load$.loadGlobal(Load.scala:193)
at sbt.internal.Load$.defaultWithGlobal(Load.scala:150)
at sbt.internal.Load$.$anonfun$defaultLoad$1(Load.scala:64)
at sbt.internal.Load$.timed(Load.scala:1395)
at sbt.internal.Load$.defaultLoad(Load.scala:60)
at sbt.BuiltinCommands$.liftedTree1$1(Main.scala:829)
at sbt.BuiltinCommands$.doLoadProject(Main.scala:829)
at sbt.BuiltinCommands$.$anonfun$loadProjectImpl$2(Main.scala:800)
at sbt.Command$.$anonfun$applyEffect$4(Command.scala:142)
at sbt.Command$.$anonfun$applyEffect$2(Command.scala:137)
at sbt.Command$.process(Command.scala:181)
at sbt.MainLoop$.processCommand(MainLoop.scala:151)
at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:139)
at sbt.State$$anon$1.runCmd$1(State.scala:246)
at sbt.State$$anon$1.process(State.scala:250)
at sbt.MainLoop$.$anonfun$next$1(MainLoop.scala:139)
at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
at sbt.MainLoop$.next(MainLoop.scala:139)
at sbt.MainLoop$.run(MainLoop.scala:132)
at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:110)
at sbt.io.Using.apply(Using.scala:22)
at sbt.MainLoop$.runWithNewLog(MainLoop.scala:104)
at sbt.MainLoop$.runAndClearLast(MainLoop.scala:59)
at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:44)
at sbt.MainLoop$.runLogged(MainLoop.scala:35)
at sbt.StandardMain$.runManaged(Main.scala:138)
at sbt.xMain.run(Main.scala:89)
at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
at xsbt.boot.Launch$.run(Launch.scala:109)
at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
at xsbt.boot.Launch$.launch(Launch.scala:117)
at xsbt.boot.Launch$.apply(Launch.scala:18)
at xsbt.boot.Boot$.runImpl(Boot.scala:56)
at xsbt.boot.Boot$.main(Boot.scala:18)
at xsbt.boot.Boot.main(Boot.scala)
Caused by: java.lang.ClassNotFoundException:
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at jline.TerminalFactory.create(TerminalFactory.java:100)
... 101 more
[info] Loading settings for project global-plugins from build.sbt,plugins.sbt ...
[info] Loading global plugins from C:Usersxxx.sbt1.0plugins
[info] Loading project definition from C:UsersxxxScalaProjectsminedemohelloproject
[info] Loading settings for project hello from build.sbt ...
[info] Set current project to hello-world (in build file:/C:/Users/xxx/ScalaProjects/minedemo/hello/)
[error] Not a valid command: none (similar: new)
[error] Not a valid project ID: none
[error] Expected ':'
[error] Not a valid key: none (similar: runner, name, console)
[error] none
[error] ^
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
我不确定是 Emacs 配置问题还是 SBT 配置问题,我是 Scala 和 Emacs 的新手,非常感谢任何帮助,它阻止了我很多时间
从 emacs-sbt-mode 中找到了一个解决方案
https://github.com/ensime/emacs-sbt-mode/issues/120
(setq sbt:program-options '())
为我工作:
- 操作系统: 视窗 10 x64 版
- SBT:1.2.8
- JDK:1.8.0_211
- Emacs:2019-06-14 的 26.2.90(build 2,x86_64-w64-mingw32(
- SBT 模式:2.0.0
- 斯卡拉模式:1.0.0
- 环境:2.0.2