Issues understanding how to use Jython

谁都会走 提交于 2019-12-01 08:28:40

I think the answer is CLASSPATH.

hello.py

print "Hello"

Let's run it

> python hello.py
Hello

> jython hello.py
Hello

Compile (I used py_compile to compile single file)

> jython -m py_compile hello.py

Run with java

> java -classpath d:\P\jython253\jython.jar;. hello$py
Hello

Note the dot in classpath. It is required for java to find your compiled class in current directory.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!