Tuesday, November 22, 2011

Rahino - Javascript for Java

Rhino is an open-source implementation of JavaScript written entirely in Java. It is managed by Mozilla Foundation.
It provides scripting for end users.

"Rhino converts JavaScript scripts into classes. Rhino works in both compiled as well as interpreted mode. It is intended to be used in server-side applications, hence there is no built-in support for the browser objects that are commonly associated with JavaScript.
Rhino can be used as a debugger by making use of the Rhino shell. It can be used in applications by embedding Rhino.
A slightly modified version of Rhino 1.6r2 comes bundled with the Sun Microsystems release of Java SE version 6, which was released in December 2006. This makes it easier to integrate JavaScript as part of Java programs and to access Java resources from JavaScript. Other implementations of Java 6 may differ." - Wikipedia

Rhino Shell

This will allow you to run scripts from files or interactively at a command line.

Download Rhino from http://www.mozilla.org/rhino/download.html 

Unzip it and go inside the directory from th terminal and type "java -jar js.jar"

I hope this is a good way to start experimenting Rhino.

No comments:

Post a Comment