title: Is it possible to have Nashorn load scripts from classpath?
body: <p>Is it possible to have Nashorn's <code>load</code> method use the project's classpath when resolving URIs?</p>
  
  <p>Here's what I'm attempting to do:</p>
  
  <pre><code>(defn create-engine
    "Creates a new nashorn script engine and loads dependencies into its context."
    [dependencies]
    (let [nashorn (.getEngineByName (ScriptEngineManager.) "nashorn")
          scripts (map #(str "load('" % "');") dependencies)]
      (.eval nashorn "var global = this;")
      (doseq [script scripts] (.eval nashorn script))
      nashorn))
  
  (def app "public/javascripts/app.js") ; in /resouces, on classpath
  
  
  ; resulting exception:
  clojure.lang.Compiler$CompilerException: 
  javax.script.ScriptException: TypeError: 
  Cannot load script from public/javascripts/app.js in &lt;eval&gt; at line number 1
  </code></pre>