title: Switching from Nashorn to Rhino (Gradle)
body: <p>I'm using Java 8 with Kotlin and one of the libraries in my project (<a href="http://michel-kraemer.github.io/citeproc-java/" rel="nofollow">http://michel-kraemer.github.io/citeproc-java/</a>) refuses to run on the Nashorn JavaScript interpreter bundled with Java 8. The solution is to use the Rhino JavaScript interpreter instead.</p>
  
  <p>I'm using Gradle to build my project. I've already added Rhino to my dependencies, but the library still insists on using Nashorn. </p>
  
  <pre><code>compile 'org.mozilla:rhino:1.7.7.1' 
  </code></pre>
  
  <p>Furthermore the following code produces a NullPointerException:</p>
  
  <pre><code>val m = ScriptEngineManager()
  // specifically look for "rhino" engine
  val engine = m.getEngineByName("rhino")
  </code></pre>
  
  <p>So it seems that Rhino is not on the classpath anywhere. How do I make sure Rhino is available to my application?</p>