{"id":13483354,"url":"https://github.com/mozilla/rhino","last_synced_at":"2026-02-15T22:18:27.944Z","repository":{"id":1490643,"uuid":"1739767","full_name":"mozilla/rhino","owner":"mozilla","description":"Rhino is an open-source implementation of JavaScript written entirely in Java","archived":false,"fork":false,"pushed_at":"2025-05-10T12:12:24.000Z","size":26678,"stargazers_count":4335,"open_issues_count":266,"forks_count":878,"subscribers_count":173,"default_branch":"master","last_synced_at":"2025-05-12T02:24:57.413Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://rhino.github.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mozilla.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2011-05-12T18:47:26.000Z","updated_at":"2025-05-10T22:08:18.000Z","dependencies_parsed_at":"2023-07-05T18:48:29.686Z","dependency_job_id":"a756dbb5-ac11-4370-8a67-3c2f33867199","html_url":"https://github.com/mozilla/rhino","commit_stats":{"total_commits":4397,"total_committers":149,"mean_commits":29.51006711409396,"dds":0.748464862406186,"last_synced_commit":"efa49df66aff6e467189328d87bd3f0ba12ddb68"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla%2Frhino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla%2Frhino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla%2Frhino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla%2Frhino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mozilla","download_url":"https://codeload.github.com/mozilla/rhino/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253672612,"owners_count":21945477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T17:01:10.389Z","updated_at":"2026-02-15T22:18:27.939Z","avatar_url":"https://github.com/mozilla.png","language":"JavaScript","readme":"# Rhino: JavaScript in Java\n\n\u003ca title=\"Rodrigo J De Marco, CC0, via Wikimedia Commons\" href=\"https://commons.wikimedia.org/wiki/File:Rhino_(234581759).jpeg\"\u003e\u003cimg width=\"384\" alt=\"Rhino (234581759)\" src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/4/4f/Rhino_%28234581759%29.jpeg/512px-Rhino_%28234581759%29.jpeg\"\u003e\u003c/a\u003e\n\nRhino is an implementation of JavaScript in Java.\n\n## License\n\nRhino is licensed under the [MPL 2.0](./LICENSE.txt).\n\n## Summary\n\nRhino requires Java 11 or higher to run, and 21 or higher to build. Java\n25 is highly recommended.\n\nTo build and run a Rhino shell:\n\n    ./gradlew run -q --console=plain\n\nTo run the tests:\n\n    git submodule init\n    git submodule update\n    ./gradlew check\n\n## Releases\n\nThe current release is \u003ca href=\"https://github.com/mozilla/rhino/releases/tag/Rhino1_9_0_Release\"\u003eRhino 1.9.0\u003c/a\u003e. Please see the [Release Notes](./RELEASE-NOTES.md).\n\n\u003cdetails\u003e\u003csummary\u003eReleases\u003c/summary\u003e\n\u003ctable\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/mozilla/rhino/releases/tag/Rhino1_9_0_Release\"\u003eRhino 1.9.0\u003c/a\u003e\u003c/td\u003e\u003ctd\u003eDecember 22, 2025\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/mozilla/rhino/releases/tag/Rhino1_8_1_Release\"\u003eRhino 1.8.1\u003c/a\u003e\u003c/td\u003e\u003ctd\u003eDecember 2, 2025\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/mozilla/rhino/releases/tag/Rhino1_8_0_Release\"\u003eRhino 1.8.0\u003c/a\u003e\u003c/td\u003e\u003ctd\u003eJanuary 2, 2025\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/mozilla/rhino/releases/tag/Rhino1_7_15_Release\"\u003eRhino 1.7.15\u003c/a\u003e\u003c/td\u003e\u003ctd\u003eMay 3, 2024\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/mozilla/rhino/releases/tag/Rhino1_7_14_Release\"\u003eRhino 1.7.14\u003c/a\u003e\u003c/td\u003e\u003ctd\u003eJanuary 6, 2022\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/mozilla/rhino/releases/tag/Rhino1_7_13_Release\"\u003eRhino 1.7.13\u003c/a\u003e\u003c/td\u003e\u003ctd\u003eSeptember 2, 2020\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/mozilla/rhino/releases/tag/Rhino1_7_12_Release\"\u003eRhino 1.7.12\u003c/a\u003e\u003c/td\u003e\u003ctd\u003eJanuary 13, 2020\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/mozilla/rhino/releases/tag/Rhino1_7_11_Release\"\u003eRhino 1.7.11\u003c/a\u003e\u003c/td\u003e\u003ctd\u003eMay 30, 2019\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/mozilla/rhino/releases/tag/Rhino1_7_10_Release\"\u003eRhino 1.7.10\u003c/a\u003e\u003c/td\u003e\u003ctd\u003eApril 9, 2018\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/mozilla/rhino/releases/tag/Rhino1_7_9_Release\"\u003eRhino 1.7.9\u003c/a\u003e\u003c/td\u003e\u003ctd\u003eMarch 15, 2018\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/mozilla/rhino/releases/tag/Rhino1_7_8_Release\"\u003eRhino 1.7.8\u003c/a\u003e\u003c/td\u003e\u003ctd\u003eJanuary 22, 2018\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/mozilla/rhino/releases/tag/Rhino1_7_7_2_Release\"\u003eRhino 1.7.7.2\u003c/a\u003e\u003c/td\u003e\u003ctd\u003eAugust 24, 2017\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/mozilla/rhino/releases/tag/Rhino1_7_7_1_RELEASE\"\u003eRhino 1.7.7.1\u003c/a\u003e\u003c/td\u003e\u003ctd\u003eFebruary 2, 2016\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/mozilla/rhino/releases/tag/Rhino1_7_7_RELEASE\"\u003eRhino 1.7.7\u003c/a\u003e\u003c/td\u003e\u003ctd\u003eJune 17, 2015\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/mozilla/rhino/releases/tag/Rhino1_7_6_RELEASE\"\u003eRhino 1.7.6\u003c/a\u003e\u003c/td\u003e\u003ctd\u003eApril 15, 2015\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/mozilla/rhino/releases/tag/Rhino1_7R5_RELEASE\"\u003eRhino 1.7R5\u003c/a\u003e\u003c/td\u003e\u003ctd\u003eJanuary 29, 2015\u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\u003c/details\u003e\n\n\n[Compatibility table](https://mozilla.github.io/rhino/compat/engines.html) which shows which advanced JavaScript\nfeatures from ES6, and ES2016+ are implemented in Rhino.\n\n[![GitHub Action Status](https://github.com/mozilla/rhino/actions/workflows/gradle.yml/badge.svg)](https://github.com/mozilla/rhino/actions/workflows/gradle.yml)\n\n## Documentation\n\nInformation for script builders and embedders:\n\n[Documentation](https://rhino.github.io)\n\n[JavaDoc](https://javadoc.io/doc/org.mozilla/rhino)\n\n[List of projects using Rhino](USAGE.md)\n\n## Code Structure\n\nRhino 1.7.15 and before were primarily used in a single JAR called \"rhino.jar\".\n\nNewer releases now organize the code using Java modules. There are four primary modules and one auxiliary module for Kotlin developers:\n\n* **rhino**: The primary codebase necessary and sufficient to run JavaScript code. Required by everything that uses Rhino. In releases *after* 1.7.15, this module does not contain the \"tools\" or the XML implementation.\n* **rhino-tools**: Contains the shell, debugger, and the \"Global\" object, which many tests and other Rhino-based tools use. Note that adding Global gives Rhino the ability to print to stdout, open files, and do other things that may be considered dangerous in a sensitive environment, so it only makes sense to include if you will use it.\n* **rhino-xml**: Adds the implementation of the E4X XML standard. Only required if you are using that.\n* **rhino-engine**: Adds the Rhino implementation of the standard Java *ScriptEngine* interface. Some projects use this to be able to switch between script execution engines, but for anything even moderately complex it is almost always easier and always more flexible to use Rhino's API directly.\n* **rhino-all**: This creates an \"all-in-one\" JAR that includes *rhino-runtime*, *rhino-tools*, and *rhino-xml*. This is what's used if you want to run Rhino using \"java jar\".\n\n* **rhino-kotlin**: Enhanced support for code written in Kotlin, [see the details.](./rhino-kotlin/README.md)\n\nThe release contains the following other modules, which are used while building and \ntesting but which are not published to Maven Central:\n\n* **tests**: The tests that depend on all of Rhino and also the external tests, including the Mozilla legacy test scripts and the test262 tests.\n* **it-android**: Integration tests for android, [see the details.](./it-android/README.md)\n* **benchmarks**: Runs benchmarks using JMH.\n* **examples**: Surprisingly, this contains example code.\n\n### Recommendations\n\nAll applications that embed rhino need the main \"rhino\" module. Many applications don't\nneed anything else -- consider doing the same, for a few reasons:\n\n* While \"rhino-engine\" implements the Java ScriptEngine interface, this is a strange\nabstraction that does not necessarily map well to Rhino.\n* \"rhino-tools\" includes the Global module, which many tools use because it includes\nhandy built-in functions like \"print\" and \"load\". However, these are not part of any\nformal standard, and it includes functionality to launch programs and load\nfiles that you may not necessarily want in your environment. (Note that \"rhino\" includes\nan implementation of the \"console\" object that you may want to use instead.)\n\n## Building\n\n### Requirements\n\nIt's recommended to build Rhino using Java 25. However, it will build with Java 17\nand up. The \"spotless\" tool, which enforces code formatting, will not\nrun on older Java versions -- it will emit a warning.\n\nRhino runs on Java 11 and higher. The build tools use the \"--release\" flag to ensure that only\nfeatures from Java 11 are used in the product.\n\nThe CI tools run the Rhino tests on Java 11, 17, 21, and 25. Regardless of what version of Java you are\nbuilding with, you can test on another Java version using the RHINO_TEST_JAVA_VERSION environment variable.\n\n### How to Build\n\nFor normal development, you can build the code, run the static checks, and run all the tests like this:\n\n    git submodule init\n    git submodule update\n    ./gradlew check\n\nTo just run the Rhino shell, you can do this from the top-level directory:\n\n    ./gradlew run -q --console=plain\n\nAlternately, you can build an all-in-one JAR and run that:\n\n    ./gradlew shadowJar\n    java -jar rhino-all/build/libs/rhino-all-2.0.0-SNAPSHOT.jar\n\nAnd finally, you can extract the classpath and use it in a variety of ways:\n\n    export CLASSPATH=$(./gradlew -q printClasspath)\n    java org.mozilla.javascript.tools.shell.Main\n\n### JLine-Based Console\n\nIf the JLine library is present, the Rhino shell will use it for command-line\nediting. The commands above will all include JLine. However, the Gradle wrapper\ninterferes with JLine's ability to manipulate the terminal. For the best CLI\nexperience, use either of the last two options, instead of ./gradlew run.\n\n### Benchmarking\n\nYou can also run the benchmarks:\n\n    ./gradlew jmh\n\nWhen running the benchmarks you may find a couple of environment variables useful.\n* `BENCHMARK` if set will limit the benchmarks run to those matching\n  the regular expression given.\n* `INTERPRETED` can be set to `true` or `false` to only run the\n  benchmarks in interpreted or compiled mode.\n* `PROFILERS` can be set to `cpu` or `alloc` to run the async profiler\n  for cpu time or memory allocations, or can be set to any other\n  string which will be passed to jmh as the value of the profilers\n  argument. This allows for things like running JFR as the profiler to\n  collect information on lock contention or other events.\n\n### Testing on other Java Versions\n\nIt is a good idea to test major changes on Java 11 before assuming that they will pass the CI\ntests. To do this, set the environment variable RHINO_TEST_JAVA_VERSION to the version that you\nwant to test. For example:\n\n    RHINO_TEST_JAVA_VERSION=11 ./gradlew check\n\nThis will only work if Gradle can find a JDK of the appropriate version. You can troubleshoot\nthis using the command:\n\n    ./gradlew -q javaToolchains\n\nNot all installers seem to put JDKs in the places where Gradle can find them. When in doubt,\ninstallations from [Adoptium](https://adoptium.net) seem to work on most platforms.\n\n### Testing on Android\n\n[see here](./it-android/README.md)\n\n### Code Coverage\n\nThe \"Jacoco\" coverage is enabled by default for the main published modules as well as the special \n\"tests\" module. Coverage is generated for each of the main projects separately and available by\nrunning\n\n    ./gradlew jacocoTestReport\n\nTo see an aggregated coverage report for everything, which is probably what you want, run\n\n    ./gradlew testCodeCoverageReport\n\nThe result is in:\n\n    ./tests/build/reports/jacoco/testCodeCoverageReport/html\n\n## Releasing and publishing new version\n\n1. Ensure all tests are passing\n2. Remove `-SNAPSHOT` from version in `gradle.properties` in project root folder\n3. Create file `gradle.properties` in `$HOME/.gradle` folder with following properties. Populate them with maven repo credentials and repo location.\n```\nmavenUser=\nmavenPassword=\nmavenSnapshotRepo=\nmavenReleaseRepo=\n```\n\n4. Run `Gradle` task to publish artifacts to Maven Central.\n```\n./gradlew publish\n```\n5. Increase version and add `-SNAPSHOT` to it in `gradle.properties` in project root folder.\n6. Push `gradle.properties` to `GitHub`\n\n### Java 16 and later\n\nIf you are using a modular JDK that disallows the reflective access to\nnon-public fields (16 and later), you *may* need to configure the JVM with the\n[`--add-opens`](https://docs.oracle.com/en/java/javase/17/migrate/migrating-jdk-8-later-jdk-releases.html#GUID-12F945EB-71D6-46AF-8C3D-D354FD0B1781)\noption to authorize the packages that your scripts shall use, for example:\n```\n--add-opens java.desktop/javax.swing.table=ALL-UNNAMED\n```\n\nThis is not necessary just to build or test Rhino -- it may be necessary when embedding it\ndepending on what your project does.\n\n## Issues\n\nMost issues are managed on GitHub:\n\n[https://github.com/mozilla/rhino/issues](https://github.com/mozilla/rhino/issues)\n\n## Contributing PRs\n\nTo submit a new PR, please use the following process:\n\n* Ensure that your entire build passes \"./gradlew check\". This will include\ncode formatting and style checks and runs the tests.\n* Please write tests for what you fixed, unless you can show us that existing\ntests cover the changes. Use existing tests, such as those in\n\"testsrc/org/mozilla/javascript/tests\", as a guide.\n* If you fixed ECMAScript spec compatibility, take a look at test262.properties and see\nif you can un-disable some tests.\n* Push your change to GitHub and open a pull request.\n* Please be patient as Rhino is only maintained by volunteers and we may need\nsome time to get back to you.\n* Thank you for contributing!\n\n## Updating Test262 tests\n\nIf you are adding new capabilities to Rhino, you may be making more test262 tests pass, which is\na good thing. Please [see the instructions](./tests/testsrc/README.md) on how to update our test262 configuration.\n\nBecause of differences between Java and JavaScript, when testing on newer Java versions, many\nUnicode-related test262 tests appear to pass, but they will fail on Java 11. Please ignore these!\n\n### Code Formatting\n\nCode formatting was introduced in 2021. The \"spotless\" plugin will fail your\nbuild if you have changed any files that have not yet been reformatted.\nPlease use \"spotlessApply\" to reformat the necessary files.\n\nIf you are the first person to touch a big file that spotless wants to make\nhundreds of lines of changes to, please try to put the reformatting changes\nalone into a single Git commit so that we can separate reformatting changes\nfrom more substantive changes.\n\nCurrently, you must be building on Java 17 or higher for Spotless to run.\n\n## More Help\n\nGitHub is the best place to go with questions. For example, we use \"GitHub discussions\":\n\n[https://github.com/mozilla/rhino/discussions](https://github.com/mozilla/rhino/discussions)\n","funding_links":[],"categories":["JavaScript","C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmozilla%2Frhino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmozilla%2Frhino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmozilla%2Frhino/lists"}