jpype-project / jpype

JPype is cross language bridge to allow Python programs full access to Java class libraries.
http://www.jpype.org
Other
1.06k stars 174 forks source link

Attach to existing JVM documentation #1186

Open marlow-fawn opened 1 month ago

marlow-fawn commented 1 month ago

I couldn't find any documentation for using an existing JVM - is it possible to add an example somewhere in the docs?

          It is possible with some modifications.    In android we use an existing JVM to run JPype.   It is just a matter to some patching the startJVM and the C++ to match the android path to use an existing JVM rather than spawn a fresh copy.

Originally posted by @Thrameos in https://github.com/jpype-project/jpype/issues/1084#issuecomment-1219656151

Thrameos commented 1 month ago

I completed that as a demo for KIVY folks. I ran all of the JPype test bench with only one failure (some issue with JNI acting differently resulting in a crash but is was a rare edge case). Unfortunately the KIVY folks never picked up the ball to test it beyond my runs in the emulator. The ANDRIOD #if/#endif shows the changes that were needed. It has been about 3 years since I last ran it myself, but if someone with wants to get it running again and document it more it is doable.