To compile a JavaScript file into java byte code invoke the following class
org.mozilla.javascript.tools.jsc.Main
In most of the time, if we want to compile the JavaScript file, we should start a Rhino session in order to invoke the org.mozilla.javascript.tools.jsc.Main class. This may be trivial if we have to compile a batch of files at a time. Thus, it's better if we can have a command instead of invoking a jar class file.
Thus, I've written a step by step tutorial on how to create a jsc command and how to execute the command in the rhino tutorial website.
Happy programming,
Cloudgen Wong
0 意見:
張貼意見