The absolute path should always start with a slash "/public/javascripts/app.js", but I'm not sure if load()loading the class path, if you don't need it, you might have to use the method eval(Reader)and build the reader yourself
EDIT:
, . , . InputStream eval reader, Java :
nashorn.eval (new InputStreamReader (getClass().getResourceAsStream("/public/javascripts/app.js")));
clojure, .
EDIT2:
, :
(defn create-engine
"Creates a new nashorn script engine and loads dependencies into its context."
[dependencies]
(let [nashorn (.getEngineByName (ScriptEngineManager.) "nashorn")]
(.eval nashorn "var global = this;")
(doseq [dependency dependencies] (.eval nashorn (new InputStreamReader (.getResourceAsStream String dependency))))
nashorn))
, -