Execute script stored as a string

A. Sundararajan sundararajan.athijegannathan at oracle.com
Sun Dec 8 23:24:05 PST 2013


Please stick to public API supported by nashorn:

http://download.java.net/jdk8/docs/api/javax/script/package-frame.html

Please check this guide for usage patterns:

http://download.java.net/jdk8/docs/technotes/guides/scripting/nashorn/

There is nashorn specific extension (experimental!) API under 
jdk.nashorn.api.scripting package which you can look at by generating 
javadoc on nashorn project.

Anything in jdk.nashorn.internal.* is nashorn internal implemenation 
stuff - which could be (and will be!) changed without any notice.

-Sundar

On Sunday 08 December 2013 10:53 PM, buddhi mihara wrote:
> i need to execute script which given as string.let say i have script file call foo.js and i store contents of that file as a string.and i need to execute that script code and get the output to the current context.how should i do that
> thank youBuddhi Nipun Mihara 		 	   		



More information about the nashorn-dev mailing list