blob: 619cad1dd26b69644cdc417ca9b47005244795e0 [file] [edit]
<h1>Rhino: JavaScript in Java</h1>
<p><img src="https://developer.mozilla.org/@api/deki/files/832/=Rhino.jpg" alt="Rhino" title="" /></p>
<p>Rhino is an implementation of JavaScript in Java.</p>
<h2>License</h2>
<p>Rhino is licensed under the <a href="./LICENSE.txt">MPL 2.0</a>.</p>
<h2>Releases</h2>
<table>
<tr><td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7R5_RELEASE">Rhino 1.7R5</a></td><td>January 29, 2015</td></tr>
<tr><td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_6_RELEASE">Rhino 1.7.6</a></td><td>April 15, 2015</td></tr>
<tr><td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_7_RELEASE">Rhino 1.7.7</a></td><td>June 17, 2015</td></tr>
<tr><td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_7_1_RELEASE">Rhino 1.7.7.1</a></td><td>February 2, 2016</td></tr>
<tr><td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_7_2_Release">Rhino 1.7.7.2</a></td><td>August 24, 2017</td></tr>
<tr><td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_8_Release">Rhino 1.7.8</a></td><td>January 22, 2018</td></tr>
<tr><td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_9_Release">Rhino 1.7.9</a></td><td>March 15, 2018</td></tr>
<tr><td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_10_Release">Rhino 1.7.10</a></td><td>April 9, 2018</td></tr>
<tr><td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_11_Release">Rhino 1.7.11</a></td><td>May 30, 2019</td></tr>
<tr><td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_12_Release">Rhino 1.7.11</a></td><td>January 13, 2020</td></tr>
</table>
<p><a href="./RELEASE-NOTES.md">Release Notes</a> for recent releases.</p>
<p><a href="http://mozilla.github.io/rhino/compat/engines.html">Compatibility table</a> which shows which advanced JavaScript
features from ES6, and ES2016+ are implemented in Rhino.</p>
<h2>Documentation</h2>
<p>Information for script builders and embedders:</p>
<p><a href="https://developer.mozilla.org/en-US/docs/Rhino_documentation">https://developer.mozilla.org/en-US/docs/Rhino_documentation</a></p>
<p>JavaDoc for all the APIs:</p>
<p><a href="http://mozilla.github.io/rhino/javadoc/index.html">http://mozilla.github.io/rhino/javadoc/index.html</a></p>
<p>More resources if you get stuck:</p>
<p><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Community">https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Community</a></p>
<h2>Building</h2>
<h3>How to Build</h3>
<p>Rhino builds with <code>Gradle</code>. Here are some useful tasks:
<code>
./gradlew jar
</code>
Build and create <code>Rhino</code> jar in the <code>buildGradle/libs</code> directory.
<code>
git submodule init
git submodule update
./gradlew test
</code>
Build and run all the tests.
<code>
./gradlew testBenchmark
</code>
Build and run benchmark tests.</p>
<h2>Releasing and publishing new version</h2>
<ol>
<li>Ensure all tests are passing</li>
<li>Remove <code>-SNAPSHOT</code> from version in <code>gradle.properties</code> in project root folder</li>
<li><p>Create file <code>gradle.properties</code> in <code>$HOME/.gradle</code> folder with following properties. Populate them with maven repo credentials and repo location.
<code>
mavenUser=
mavenPassword=
mavenSnapshotRepo=
mavenReleaseRepo=
</code></p></li>
<li><p>Run <code>Gradle</code> task to publish artifacts to Maven Central.
<code>
./gradlew publish
</code></p></li>
<li>Increase version and add <code>-SNAPSHOT</code> to it in <code>gradle.properties</code> in project root folder.</li>
<li>Push <code>gradle.properties</code> to <code>GitHub</code></li>
</ol>
<h2>Running</h2>
<p>Rhino can run as a stand-alone interpreter from the command line:
<code>
java -jar buildGradle/libs/rhino-1.7.12.jar -debug -version 200
Rhino 1.7.9 2018 03 15
js&gt; print('Hello, World!');
Hello, World!
js&gt;
</code>
There is also a "rhino" package for many Linux distributions as well as Homebrew for the Mac.</p>
<p>You can also embed it, as most people do. See below for more docs.</p>
<h2>Issues</h2>
<p>Most issues are managed on GitHub:</p>
<p><a href="https://github.com/mozilla/rhino/issues">https://github.com/mozilla/rhino/issues</a></p>
<h2>More Help</h2>
<p>The Google group is the best place to go with questions:</p>
<p><a href="https://groups.google.com/forum/#!forum/mozilla-rhino">https://groups.google.com/forum/#!forum/mozilla-rhino</a></p>