Control.java - Rhino JavaScript Engine Example

Q

How to run Control.java example provided in Rhino JavaScript 1.7R5?

✍: FYIcenter

A

You can follow this tutorial run Control.java example provided in Rhino JavaScript 1.7R5:

1. Compile the Control.java example:

>cd \fyicenter\rhino1_7R5\examples

\fyicenter\rhino1_7R5\examples>\fyicenter\jdk-1.8.0\bin\javac 
   -cp ..\js.jar Control.java

2. Run it with with JavaScript code speficied in the command line:

\fyicenter\rhino1_7R5\examples>\fyicenter\jdk-1.8.0\bin\java 
   -cp .\;..\js.jar Control

obj == result
obj.a == 1.0
obj.b[0] == x
obj.b[1] == y
{a:1, b:["x", "y"]}

 

Running Examples Provided in Rhino

⇒⇒FAQ for Rhino JavaScript Java Library

2017-08-03, 222👍, 0💬