Question

I am very interested at using the Scala script engine that we have now in scala 2.11

I saw that within the REPL everything works but if I do it from a test (I tried from sbt and maven) then the ScriptEngine for scala is not found.

I tried that to see which ScriptEngine are present

println("manager:" + manager.getEngineFactories.size())
manager.getEngineFactories.toList.foreach(factory => println(factory.getClass.getSimpleName))

But I only get NashornScriptEngine (I have JDK8)

Does anybody have an idea why I can't find it? I had previously issues with NashornScript in SBT that could be resolved by added fork in Test but this is not the issue here.

It is as if the ScriptEngine is not present in the classpath when you are outside the REPL

Was it helpful?

Solution

Did you add the REPL (and, maybe, the compiler?) to the classpath? I imagine that if you don't specify the dependency and bring only the library, it would definitely not work.

If you did do that, perhaps if you could be more forthcoming with details on how you are doing this test?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top