Skip to content

Instantly share code, notes, and snippets.

@ScalaWilliam
Last active February 12, 2017 00:09
Show Gist options
  • Save ScalaWilliam/29f09ca77f11209aeaeb92f83e553087 to your computer and use it in GitHub Desktop.
Save ScalaWilliam/29f09ca77f11209aeaeb92f83e553087 to your computer and use it in GitHub Desktop.
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