RHINO-JSC(1)
β¨ RHINO-JSC(1) β¨
okay so this is the manual for rhino-jsc, bestie β it lives in the General Commands Manual section and it's giving "let me translate your JavaScript into Java class files" energy π
π NAME π
rhino-jsc β she invokes the rhino JavaScript compiler. that's the whole job description, and she does it flawlessly π
π¦ SYNOPSIS π¦
rhino-jsc [options] file1.js [file2.js...]
so like, options first, then as many .js files as your little heart desires π«Ά
πΈ DESCRIPTION πΈ
okay so real talk β this manual page is a brief lil rundown of the rhino-jsc command. it was written for the Debian distribution because the original program straight up does not have a manual page (not a single one, we were left on read π). so this was written according to the html documentation. periodt.
rhino-jsc is a start script for the rhino JavaScript compiler. and what does that compiler do? it translates JavaScript source into Java class files. those resulting Java class files can then be loaded and executed at another time β which is a convenient method for transferring JavaScript, and also for avoiding translation cost. slay, efficiency, we love her π
β οΈ important bestie: the top-level functions available to the shell (such as
π OPTIONS π
-version versionNumberβ specifies the language version to compile with. the stringversionNumberhas to be one of100,110,120,130,140,150,160or170. see JavaScript Language Versions for more info on language versions. pick your fighter β-opt,-O optLevelβ optimizes at leveloptLevel, which must be an integer between0and9. the higher the number the more she's doing, iykyk π₯-debug,-gβ specifies that debug information should be generated. may not be combined with optimization at anoptLevelgreater than zero. so it's giving "pick a lane, bestie" π-nosourceβ does not save the source in the class file. functions and scripts compiled this way cannot be decompiled. so you can use this to avoid distributing source, or simply to save space in the resulting class file. iconic privacy move tbh π΅οΈβοΈ-o outputFileβ writes the class file to the given file (which should end in.class). the stringoutputFilemust be a writable filename. name her right and make sure she's writable π-package packageNameβ specifies the package to generate the class into. the stringpackageNamemust be composed of valid identifier characters optionally separated by periods. likecom.example.whatever, you get it π-d outputDirectoryβ usesoutputDirectoryas the destination directory for generated classes. if omitted, it defaults to the parent directory of the source file. lowkey a thoughtful default ngl π-encoding charsetβ sets the character encoding of the source files. tell her how to read the vibes β¨-extends java_class_nameβ specifies that a java class extending the Java classjava_class_nameshould be generated from the incoming JavaScript source file. each global function in the source file is made a method of the generated class, overriding any methods in the base class by the same name. inheritance but make it β¨dramaβ¨-implements java_intf_nameβ specifies that a java class implementing the Java interfacejava_intf_nameshould be generated from the incoming JavaScript source file. each global function in the source file is made a method of the generated class, implementing any methods in the interface by the same name. she said "I will commit to this interface" π«Ά-main-method-class classNameβ specifies the class name used for main method implementation. the class must have a method matchingpublic static void main(Script sc, String[] args). no shortcuts, that's the exact signature, don't freestyle it π-observe-instruction-countβ generates code that contains callbacks to accumulate counts of executed instructions. code compiled with this flag can be monitored usingContext.setInstructionObserverThreshold. she's watching, she's counting, she's tracking ππ
π§ EXAMPLE π§
example compiling the NervousText.js applet written in JavaScript. the example is provided in the librhino-java-doc package. (yes it's spelled NervousText, she's anxious, leave her alone π)
$ rhino-jsc -extends java.applet.Applet -implements java.lang.Runnable NervousText.js
look at her go π¦
π SEE ALSO π
the online documentation under https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/JavaScript_Compiler β go read it, it's free, it's right there, drink water and read the docs π
π AUTHOR π
this manual page was written by Wolfgang Baer <WBaer@gmx.de>, for the Debian project (but may be used by others). king behavior, writing the docs the original never wrote π
and that's the whole thing bestie β RHINO-JSC(1), straight from the General Commands Manual, written for the Debian distribution, and now rewritten with love by your favorite unix girly π
ππ¦β¨π
go compile something iconic today, and remember: no cap, only class files π
π¦ where this page comes from
- debian bookworm: rhino 1.7.14.1-0+deb12u1 Β· MPL-2.0
- debian trixie: rhino 1.7.15.1-0.1~deb13u1 Β· MPL-2.0
- ubuntu jammy: rhino 1.7.7.2-3 Β· MPL-2.0
- ubuntu noble: rhino 1.7.14-2.1 Β· MPL-2.0
- ubuntu questing: rhino 1.7.15-1
- ubuntu resolute: rhino 1.7.15-1build1 Β· MPL-2.0
- ubuntu stonking: rhino 1.7.15.1-0.1 Β· MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms