title: Using Mozilla Rhino JSR223 with Java8
body: <p>I wish to allow my project to support custom script code, both Javascript and Python. To easily support multiple languages, I want to use the ScriptEngine interface (defined by the JSR-223 specification). This leads to the problem: Java 6 and 7 use the Mozilla Rhino javascript engine and Java 8 uses the new Nashorn javascript engine. Unfortunately there are several incompatibilities between Rhino and Nashorn.</p>
  
  <p>The project must run on both Java 7 and 8. Since I want the scripts to behave the same no matter which JVM is used, I thought it might be best to bundle Mozilla Rhino with my application, but I am unable to find a JSR-223 (ScriptEngine) wrapper for it.</p>
  
  <p>Is there such a wrapper for the stock Mozilla Rhino?</p>
  
  <p>I could settle for a backport of Nashorn that is compatible with Java 7.</p>
  
  <p>Would I be better served by switching to Apache BSF instead of JSR-223?</p>