Rhino JavaScript Example - RunScript.java

Q

How to run Rhino JavaScript Example, RunScript.java?

✍: FYIcenter.com

A

RunScript.java is an example program provided in the rhino-Rhino1_7_14_Release.zip package. It allows you to run JavaScript statements in a single command line.

Here is how to use RunScript.java, if you have rhino-runtime-1.7.14.jar installed:

fyicenter> cd rhino-Rhino1_7_14_Release

rhino-Rhino1_7_14_Release> cd examples

examples> java -cp ../../rhino-runtime-1.7.14.jar RunScript.java "Math.PI;"
3.141592653589793

examples> java -cp ../../rhino-runtime-1.7.14.jar RunScript.java 'function p2k(p) {return p*0.453592;} p2k(5.0);'
2.26796

 

Rhino Tool - JavaScript Compiler

Rhino JavaScript Example - Shell.java

Rhino JavaScript Examples and Tools

⇑⇑ FAQ for Rhino JavaScript Java Library

2022-04-13, 255👍, 0💬