Nashorn script engine not found when running under sbt
See original GitHub issueHi, I have previously created an issue at Play project but it seems to be more sbt related. The issue is the following. I have just upgraded to Java 8 and I want to use Nashorn. Simply put, I have two projects, one scala lib and a play project to have a GUI.
I haven’t seen the issue straight away because the scala lib uses maven but when I try to load nashorn after running play with sbt -> run, the engine is not found and if I try to do it manually (new NashornScriptEngineFactory) I get a ClassDefNotFound.
I have created a very simple test from the basics scala project.
The code I have added is the following
"Nashorn" should "be available" in {
import javax.script._
val manager = new ScriptEngineManager()
val engine = manager.getEngineByName("nashorn")
engine should not be null
}
For play, when I create a distribution and run it from outside sbt everything works and nashorn is found.
Issue Analytics
- State:
- Created 9 years ago
- Comments:19 (9 by maintainers)
Top Results From Across the Web
Scala Script Engine is not found when run in Test using Mill or ...
I have a strange behaviour concerning Testing Scala Script Engine. I have the following code: val manager = new ScriptEngineManager(getClass ...
Read more >graalvm/graaljs - Gitter
Hi together, seems my code for interop between CompletableFuture and JS Promise fails on rc13 while it was executing fine on rc12. The...
Read more >Why won't MATLAB find the java nashorn ScriptEngine?
First, let me make it clear that the nashorn engine is only available in java 1.8. I am using MATLAB R2015b and I...
Read more >2 The Nashorn Java API
This chapter describes how to access Java from a script interpreted by the Nashorn engine.
Read more >The importance of Scala.js
Programmers often ask me were Scala.js stands in the bigger picture, ... and at the time in 2017, I could not find a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had the same problem with SBT project, and this worked for me
re JSR 223, let’s discuss further at https://issues.scala-lang.org/browse/SI-8422