ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peter.kitt.rei...@gmail.com>
Subject Re: Beginner question: Ant+ Eclipse + script-task: BSF's & Rhino E4X issue
Date Thu, 21 Jul 2011 11:07:18 GMT
The problem you are running into is that a version of rhino
is in java itself (since jdk 6)
and this version is in the root classloader and so using
a different version is very hard (I cannot remember how to
do it).

The good news is that with jdk 7, the embedded rhino
has been updated to a newer version see:
http://bugs.sun.com/view_bug.do?bug_id=6980447

This means that using jdk 7 and ant 1.8
the following build.xml  works:

<project default="e4x">
  <target name="e4x">
    <script language="javascript"><![CDATA[
      importPackage(java.lang);
      var doc = <a><b c="1"/><b c="2"/></a>;
      doc.@c="new value";
      System.out.println(doc);
        ]]>
    </script>
  </target>
</project>

without messing around with bsf.

since ant will in this case use javax.scripting

Peter


On Thu, Jul 21, 2011 at 10:02 AM, Bart van der Schoor
<bartvanderschoor@gmail.com> wrote:
> Hi,
>
> I'm new to Ant and advanced usage of Eclipse, and I got terribly lost while
> trying to solve the following. Worst of all i have no idea where to turn to
> solve this so i hope somebody here can help more of point me in the right
> direction (so many projects).
>
> I have an Ant script-task using javascript where I want to parse XML using
> E4X.  If I check the Ant project page I see it uses BSF which in turn uses
> Rhino. But the E4X doesn't work: it seems like the Rhino it's using doesn't
> have it supported. But when i browse Rhino's release I see it in 1.6, which
> dates to 2004 (http://www.mozilla.org/rhino/rhino16R1.html).
>
> The i tried to find out which version of Rhino is being used by the Ant
> that's in my Eclipse, and tthen it all goes foggy. I tried googling and
> browsing the different projects, but it's so confusing. I also tried
> browsing release notes, but i have no idea which project to look in.
>
> Can anyone give me some pointers on this?
>
> I'm using Ant 1.8.2 in FDT, which is a standalone version of an ActionScript
> plugin for Eclipse. It's FDT 4.5, which runs on Eclipse 3.5.0. It originally
> shipped with Ant 1.7.1, but when solving an issue with the FTP task the
> support guys send me an updated Ant 1.8.2 and the additional jar's
> (commons-net and jakarta-oro). My workstation is an Windows XP machine, and
> is using Sun jdk1.6.0_21.
>
> Grtz,
>
> Bart
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message