0

有没有办法从它自己的程序(没有包管理器)中安装 rhino 版本?

$ rhino -v
Invalid option "-v"
Usage: java org.mozilla.javascript.tools.shell.Main [options...] [files]
Valid options are:
    -?, -help          Displays help messages.
    -w                 Enable warnings.
    -version 100|110|120|130|140|150|160|170|180
                       Set a specific language version.
    -opt [-1|0-9]      Set optimization level.
    -f script-filename Execute script file, or "-" for interactive.
    -e script-source   Evaluate inline script.
    -modules [uri]     Add a single path or URL element to the CommonJS
                       module search path. (implies -require)
    -require           Enable CommonJS module support.
    -sandbox           Enable CommonJS sandbox mode. (implies -require)
    -debug             Generate debug code.
    -strict            Enable strict mode warnings.
    -fatal-warnings    Treat warnings as errors.
    -encoding charset  Use specified character encoding as default when reading scripts.

我得到的只是那些选项,根本没有版本..

4

1 回答 1

0

啊,我明白了!

$ echo 'quit()' | rhino 2>&1 | grep Rhino
Rhino 1.7 release 4 2012 09 15
于 2013-07-03T05:52:45.320 回答