<p>I'd like to use the <a href="https://developer.mozilla.org/en/Rhino_JavaScript_Compiler" rel="nofollow noreferrer">Rhino JavaScript</a> compiler to compile some JavaScript to .class bytecode files for use in a project. It seems like this should already exist, since there are groovyc, netrexxc, and jythonc tasks for Groovy, NetREXX(!) and Jython, respectively. Has anyone used or written such an Ant task, or can anyone provide some tips on how to write one?</p>

<p>Ideally it would have some way to resolve dependencies among JavaScript or Java classes.</p>

Why not simply use java task?
```
```
<java fork="yes" 
  classpathref="build.path" 
  classname="org.mozilla.javascript.tools.jsc.Main" 
  failonerror="true">
    <arg value="-debug"/>
        ...
    <arg value="file.js"/>          
</java>
```
```
Any objections?