Most embeddings won't need any of the classes in org.mozilla.javascript.tools or any of its sub-packages.
It is possible to run Rhino with interpreter mode only, allowing you to remove classes for classfile generation that include all the classes from org.mozilla.javascript.optimizer package and ClassNameHelper, ClassRepository classes from org.mozilla.javascript package.
Implementing the JavaAdapter functionality requires the ability to generate classes on the fly. Removing org.mozilla.javascript.JavaAdapter will disable this functionality, but Rhino will otherwise run correctly.
If you do not include Optimizer or JavaAdapter, then you do not need Rhino library for class file generation and you can remove all the classes from in org.mozilla.classfile package.
The package org.mozilla.javascript.regexp can be removed. Rhino will continue to run, although it will not be able to execute any regular expression matches. This change saves 47,984 bytes of class files.
Debug information in Rhino classes consumes about 25% of code size and if you can live without that, you can recompile Rhino to remove it.
ant clean ant -Ddebug=off -Dno-regexp=true smalljarIf you omit -Dno-regexp=true, then the resulting smalljs.jar will include Regular Expression support.