Learning Rhino - 1
Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically embedded into Java applications to provide scripting to end users.
The rhino shell provides a simple way to run scripts in batch mode.
The syntax is:
java org.mozilla.javascript.tools.shell.Main [options] script-filename-or-url [script-arguments]
Example 1:
First of all, download the latest rhino and extract the zip file(for example: c:rhino1_7R2).
Second, add “c:rhino1_7R2js.jar” to the CLASSPATH of your environment.
Third, add a JavaScript file “c:test.js”, the content is:
print("Hello World!");
Fourth, open CMD window and input following command:
java org.mozilla.javascript.tools.shell.Main c:test.js
the output will be:
Hello World!
OK. We have got the basic concept of Rhino.
Example 2:
1. Open the test.js and modify the content:
for (var i=0; i2. Open the CMD window:
java org.mozilla.javascript.tools.shell.Main c:test.js Hello World!3. Output:
HelloWorld!Example 3:
1. Modify the test.js:function add() { var result = 0;for (var i=0; i2. Open the CMD window:
java org.mozilla.javascript.tools.shell.Main c:test.js3. Output:
9
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/3705/viewspace-2806216/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Learning Rhino - 2
- Deep learning - note 1
- Learning Java day1Java
- Machine Learning (1) - Linear RegressionMac
- Rhino 8 中文安裝包「犀牛 Rhino 8破解新功能」
- 翻譯 | Learning React Without Using React Part 1React
- 開發Rhino外掛
- Rhino 8 (犀牛 8)for Mac 最新啟用 親測可用 支援M1Mac
- kinect2.0 Self-Learning (1) - recycling disconnect (solved)
- 《Learning ELK Stack》1 ELK技術棧介紹
- Deep Learning for joint channel estimation and feedback in massive MIMO systems(1)
- rhino5.0安裝教程
- 樹狀陣列learning Day1識海社群打卡1st陣列
- rhino 的擠出曲線命令
- Rhino基礎操作3 - 出圖篇
- 中文Rhino 8新增內容介紹
- 犀牛3D建模Rhino 7 Mac3DMac
- Rhino 7犀牛3D建模工具3D
- [Active Learning] Multi-Criteria-based Active Learning
- Imitation LearningMIT
- learning sequelize
- Meta Learning
- Learning TypeScriptTypeScript
- Rhino 7 犀牛3D建模軟體3D
- Rhino 7 犀牛3D建模軟體3D
- 【Learning eBPF-1】什麼是 eBPF?為什麼它很吊?eBPF
- ml-10-1-規模機器學習( ( Large Scale Machine Learning) )機器學習Mac
- 2018-07-28-論文閱讀(1)-Learning Ensembled for Structured Prediction RulesStruct
- gitglossary learning by examplesGit
- 《machine learning》引言Mac
- Machine Learning with SklearnMac
- Python Learning: 03Python
- Python Learning: 01Python
- Learning MySQL and MariaDBMySql
- 犀牛3D建模軟體Rhino 7 for Mac3DMac
- Rhino 7 for Mac(犀牛3D建模軟體)Mac3D
- Rhino 7 for Mac 犀牛3D建模軟體Mac3D
- Rhino 7 for Mac(犀牛3D造型軟體)Mac3D