[2.0.4] macOS: using sikulixapi by jpype --- currently not possible

Asked by Yang

**************** tracked on GitHub: https://github.com/RaiMan/SikuliX1/issues/400
-------------------------------------------------------------------------------------------------------------------------------

I tried to use Jpype1 (https://pypi.org/project/JPype1/) to automate GUI with 'sikulixapi.jar' on macOS.
This package works well when I imported it on my java project, but had problem when I used Jpype1 to access it.

Here is my code:
`from jpype import *

startJVM(get_default_jvm_path(), '-ea', r'-Djava.class.path=somepath/sikulixapi.jar')
Screen = JClass('org.sikuli.script.Screen')
s = Screen()
`
When the code ran into 'Screen = JClass('org.sikuli.script.Screen')', my program was in deadlock. Not any responses unless ending the python process.

I'm looking forward to your suggestions,thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Which SikuliX?
Which Java?

I will make some tests the next days on macOS 11, Java 11 (AdoptOpenJDK) and SikuliX 2.0.4 and report here.

Revision history for this message
Yang (bluceyang) said :
#2

thanks!
my java version is "1.8.0_251"
and sikulixapi-2.0.4

Revision history for this message
RaiMan (raimund-hocke) said :
#3

tracked on GitHub

Revision history for this message
RaiMan (raimund-hocke) said :
#4

my tests showed, that it does not work.

Revision history for this message
Yang (bluceyang) said :
#5

thanks for your help , maybe I will try other ways to use it

Revision history for this message
judy hopps (judylucky) said :
#6

I hava the same issue, how to fix, OMG