Start and stop JVM several times

36 views
Skip to first unread message

YASMINE CHAOUCHE

unread,
Apr 10, 2022, 12:44:21 PM4/10/22
to python-weka-wrapper
hello, 
Why it is not possible to start and stop the JVM several times:
for example :
executing a one python file:
jvm.start()
 // code
jvm.stop()
//code
jvm.start()
 // code
jvm.stop()
when trying, I got this error: RuntimeError: Failed to start Java VM.

Maybe I can add some options in jvm.start() function to make it possible?

Thanks for helping 

Peter Reutemann

unread,
Apr 10, 2022, 4:50:34 PM4/10/22
to python-weka-wrapper
No. That's unfortunately one of the limitations of the underlying
python-javabridge library:
https://github.com/LeeKamentsky/python-javabridge/issues/88

However, a potential workaround in that same thread that got posted
last year may work for you (I haven't tested it):
https://github.com/LeeKamentsky/python-javabridge/issues/88#issuecomment-817875968

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174 (office)
+64 (7) 577-5304 (home office)
https://www.cs.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
Reply all
Reply to author
Forward
0 new messages