Determine if the Java Virtual Machine (JVM) is or is not running.
1 2 3 4 5 6 7 8 9
import py5_tools # this will be False py5.println(py5_tools.is_jvm_running()) import py5 # now it will be True py5.println(py5_tools.is_jvm_running())
Determine if the Java Virtual Machine (JVM) is or is not running. When the py5 library is imported it will start the JVM. Therefore this will be
import py5 is executed and
True afterwards. It should continue to always be
True unless somewhere there is some Java code that calls
System.exit() is not recommended. If for some reason the JVM crashes (perhaps through a segmentation fault), the JVM will no longer be running, but that crash will most likely also terminate the Python interpreter.
is_jvm_running() -> bool
Updated on September 11, 2021 16:51:34pm UTC