Does Java 6 include a program that can run javax.script files (Rhino JS)?

I found that Java 6 includes Rhino JS (with the exception of one or two minor parts), like javax.script. Pretty cool!

Is there a binary installed in Java 6 (JRE or JDK) that I can just point to the .js file to run? (I think it would be great to provide source code for reading and running others, without compilation, and require only Java to be installed). Or do I need to create a small 8-line program in documents?

+3
source share
3 answers

Yes there jrunscript

+5
source

, JDK, jrunscript:

wookie@hoth:/usr/local/java/bin$ ./jrunscript 
js> println("This is hello from test.js");
This is hello from test.js
+1

Debian Rhino js. js:

#/usr/bin/js

and install the executable for the script to run them directly.

0
source

Source: https://habr.com/ru/post/1755871/


All Articles