jpype-project / jpype

JPype is cross language bridge to allow Python programs full access to Java class libraries.
http://www.jpype.org
Apache License 2.0
1.12k stars 183 forks source link

Add support for module-path #1230

Open Thrameos opened 2 weeks ago

Thrameos commented 2 weeks ago

Recently I have been attempting to use JavaFX from within JPype, but this requires the use of modules. Unfortunately, we have never created the same interface for modules that we did for classpath and thus one has to specify everything manually.

astrelsky commented 2 weeks ago

This should be pretty simple to do. You can do it by providing the --modulepath with the vmargs or at runtime using the approach in the example. https://docs.oracle.com/javase/9/docs/api/java/lang/ModuleLayer.html

The only time I've ever used modules is when trying to exploit bluray disc java, so I don't know that much.

Thrameos commented 2 weeks ago

Fully agree. Though I do think we should make it similar to classpath taking a list.

jpype.startJVM(modulepath=["path1","path2"])

Other wise we risk exposing them to the fact that Java uses different path separators for other systems. Though this would be trivial to add I am going to work on it post 1.5.2 release. I am trying to make use of the Javascript engine in Webview and there are a number of support routines that will be needed to make the suers life easier. I am thinking that would be good items for a 1.6.0 release.