I'm trying to use the recent version of Rhino in the ant tag, but it seems to use the version of Rhino that comes with the JVM. I tried setting the classpath to indicate the jar of the Rhino script. I have currently tried the following:
<project default="hello" name="hello-world" basedir=".">
<target name="hello">
<script language="javascript">
<classpath>
<pathelement location="js.jar"/>
</classpath><![CDATA[
x=<hello><world/></hello>
]]></script>
</target>
</project>
Note the inclusion of E4X syntax in a script that should only work in Rhino from Mozilla, and not bundled with the JVM.
js.jar is in the same directory as ant script. I also tried renaming it to rhino.jar, since I think I saw documentation that suggested it was necessary.
When I run it, it gives the following error:
javax.script.ScriptException: sun.org.mozilla.javascript.EvaluatorException: syntax error (# 3)
, , Rhino, JVM. ?