Calling from JRuby (A. Sundararajan)
James Ladd
james_ladd at hotmail.com
Mon Jan 27 21:30:15 PST 2014
Thank you Sundar, I'll give it a try.
Will post findings here and JRuby group.
> Message: 3
> Date: Mon, 27 Jan 2014 09:31:43 +0530
> From: "A. Sundararajan" <sundararajan.athijegannathan at oracle.com>
> Subject: Re: Calling from JRuby
> To: nashorn-dev at openjdk.java.net
> Message-ID: <52E5DA27.50503 at oracle.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> 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
> jdk.nashorn.api.scripting.ScriptObjectMirror.
> You may want to refer to
> https://wiki.openjdk.java.net/display/Nashorn/Nashorn+jsr223+engine+notes
>
> -Sundar
More information about the nashorn-dev
mailing list