Skip to content

Instantly share code, notes, and snippets.

@ScalaWilliam
Last active February 12, 2017 00:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Scala ScriptEngine doesn't seem to be working as before in 2.12.1/2.12.0 via SBT.
# SBT + 2.11.8 gives us an IMain
$ sbt
> set scalaVersion := "2.11.8"
> console
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111).
scala> new javax.script.ScriptEngineManager().getEngineByName("scala")
res0: javax.script.ScriptEngine = scala.tools.nsc.interpreter.IMain@52f09302
# Loading SBT + 2.12.1 gives us a null
$ sbt
> set scalaVersion := "2.12.1"
> console
Welcome to Scala 2.12.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111).
scala> new javax.script.ScriptEngineManager().getEngineByName("scala")
res0: javax.script.ScriptEngine = null
# Here it loads a completely different class from IMain. Why is this?
$ scala
Welcome to Scala 2.12.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111).
scala> new javax.script.ScriptEngineManager().getEngineByName("scala")
res0: javax.script.ScriptEngine = scala.tools.nsc.interpreter.Scripted@71cea1b8
# I can't seem to find anything about this on www.scala-lang.org/news/2.12.0
@lare96
Copy link

lare96 commented Feb 12, 2017

Any updates on why this is happening? Super frustrating!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment