[Zope] [OT] Java Interpretter

Chris Withers chrisw@nipltd.com
Fri, 18 Jan 2002 12:23:41 +0000


Simon Coles wrote:
> 
> Python has an interpreter which makes it very easy to test stuff out.
> Python has a much shallower learning curve than Java.

Well, okay, since things are going well today, here's a Java interpretter for ya
;-)

batch file:
SET classpath=E:\LocalCVS\jpe\;.
python -i jinit.py

jinit.py:
import java
if not java.isInitialized():
    java.initialize()
from java import Jstring, importClass

sample session:
E:\>python -i jinit.py
jvm lib <C:\jdk1.3.1_02\jre\bin\classic\jvm.dll>
>>> out = importClass('java.lang.System').out
>>> out.println(Jstring('test'))
test
>>>

*grinz*

Chris