我正在尝试使用 Jython 将一个小型 Python 脚本集成到我拥有的 Java 程序中。我似乎无法使用该javax.script包获取 python/jython 引擎。
我从这里获取了代码,并做了一些小的添加来生成:
andrew@asimov:~$ echo $CLASSPATH
/opt/jython/jython.jar:.
andrew@asimov:~$ java Engines
The following 2 scripting engines were found
Engine name: jython
Version: 2.7.0
Language: python
Engine supports the following extensions:
py
Engine has the following short names:
python
jython
=========================
Engine name: Rhino
Version: Rhino 1.7 release 4 2013 08 27
Language: ECMAScript
Engine supports the following extensions:
js
Engine has the following short names:
js
rhino
JavaScript
javascript
ECMAScript
ecmascript …Run Code Online (Sandbox Code Playgroud)