Test in Eclipse works but sbt throws MissingRequirementError: object scala.runtime in compiler mirror not found

前端 未结 2 1472
长情又很酷
长情又很酷 2021-01-21 11:10

I am messing around with parsing and scala.tools.nsc.interactive.Global in Scala and I ran into a problem while executing tests under sbt. The tests run fine from E

2条回答
  •  孤城傲影
    2021-01-21 11:40

    It looks like the scala jar isn't in your classpath when running sbt - make sure to add scala-library.jar to your classpath before you run sbt.


    Based on one of your comments, it looks like you're running on windows. you might be also running into runtime jar access errors there if the classpath contains strange characters or spaces, or permission errors (e.g., if eclipse is running under an admin account, while sbt isn't).


    Try reordering your dependency list, to put scala-library ahead of scala-compiler. if that doesn't work, try the troubleshooting advice here.

提交回复
热议问题