-
Notifications
You must be signed in to change notification settings - Fork 183
UserfriendlyApiWhitepaper
baztian edited this page Sep 4, 2014
·
3 revisions
Current jpype API is too complicated and causes lots of user requests to get jpype working. This whitepaper is an attempt to simplify use of jpype with a new API.
import jpype
jpype.startJVM() # default without JVM parameters
with jpype: # attach to current Python thread and cleanup afterwards
jpype.lang.System.out.println("foobar")
honors CLASSPATH
system environment variable as java
(see man page) does. Prints a warning if startJVM has been started before with different arguments indicating that changed parameters can not be honored
classpath
: Iterable containing paths to jar files or class folders
jvm_parms
: Parameters directly passed to java vm
jvm_path
: Path to jvm so/dll
Writes a warning that shutdown isn't implemented / functioning. Does not shutdown JVM.
Do we really need to call jpype.attachThreadToJVM()
/jpype.detachThreadFromJVM()
? Isn't there a way to do this automatically?