有没有办法从它自己的程序中获得安装的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.
我得到的只是那些选项,根本没有版本..
答案 0 :(得分:0)
啊,我明白了!
$ echo 'quit()' | rhino 2>&1 | grep Rhino
Rhino 1.7 release 4 2012 09 15