JDK 6 contains javax.script (JSR-223) API and a Rhino based sample JavaScript engine. http://scripting.dev.java.net project has been created to develop JSR-223 engines for other languages and useful, demo applications that use scripting.
Just added two more script engines to http://scripting.dev.java.net. Unlike other script engines, this script engine is implemented in JavaScript. These engines implement JSP/ASP/PHP-like templating for JavaScript.
It should be possible to use these script engines in Java code as well - because these implement javax.script API as required. But, you have to create a JavaScript engine and eval the corresponding scripts. And then call ejsScriptEngineFactory or jstScriptEngineFactory function to create javax.script.ScriptEngineFactory
for these engines.
It should be possible to use the jst and ejs engines with Phobos web application framework. [though I am yet to test that part!]
I came across these other language implementations on JavaScript:
Also, it seems that JavaScript 2 would be implemented as a translater that translates js2 to js1 (atleast to startwith).