Using JPE: Problems with the java virtual machine

Markus Frank Markus.Frank at cern.ch
Fri Nov 2 17:48:23 CET 2001


Dear Python users,

I have to execute a java class from a python module.
JPE seemed to be the solution. 
But, of course, life is never that easy. I could start the 
java virtual machine from python, but as soon as java is loaded,
python craps out i.e.. no command works anymore.

Has anybody seen something similar?
Any help is welcome.
I use the sun jdk 1.3.0 and python 2.0.

Cheers,

     Markus Frank


EP Division, CERN
LHCb Experiment
CH-1211 Geneva 23

Telephone: 41 22 767 24 86
Fax:       41 22 767 94 25
E-mail:    mailto:Markus.Frank at cern.ch
WWW:       http://www.cern.ch/~frankm

J:\CMT\JPE\v1>python
Python 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> import java, sys, os, gc, javalib
>>> gc.disable()
>>> gc.set_debug( gc.DEBUG_STATS)
>>> vmargs=['-verbose:jni,gc', '-Djava.library.path=%s' % os.environ[ 'PATH'], '-Djava.class.path=' + os.environ[ 'CLASSPATH']]
>>> from java import jvm
>>> print 'Hello world'
Hello world
>>> vm=jvm.JavaVM('jvm.dll', vmargs)
..\src\jpe.cpp:i Warning s_jcache_create(): s_jrlock is NULL; creating it
>>> ..\src\jutil.cpp:172 take rlock 0x8a160c
<<< ..\src\jutil.cpp:188 release rlock 0x8a160c
>>> print 'Hello world'
  File "<stdin>", line 1
    print 'Hello world'
                       ^
SyntaxError: invalid syntax
>>> ^Z






More information about the Python-list mailing list