Calling from JRuby

A. Sundararajan sundararajan.athijegannathan at
Sun Jan 26 20:01:43 PST 2014

Hi James,

You can use jsr223 API to create nashorn engine from JRuby and evaluate 
JavaScript. You can expose Java objects as global variables to script 
(via javax.script.ScriptContext). It is also possible to implement Java 
interfaces and extend Java classes in JavaScript. Objects of such 
implementations can be passed around to JDK core classes as well as 
JRuby classes.

You can access properties of JavaScript objects via 
You may want to refer to


On Monday 27 January 2014 08:00 AM, James Ladd wrote:
> Does anyone have example code of calling Nashorn from JRuby?
> I'd like to create an environment from JRuby and then execute some
> Javascript within it.
> I'm guessing this would follow the JSR approach to invoking another
> script runtime - Yes?
> - James.

More information about the nashorn-dev mailing list