Sikulix 2.1.0 on macOS

Asked by larryli

now,I use snap2.1 on mac ios, when i execute the script, it will be failed, you have one page to introduce, it should use brew install opencv
After install opencv, same error, I want to confirm whether my jar should be compiled again on macos, because my jar is no problem on windows?

Btw, why v2.1 will not include opencv directly, because I want to run same jar on windows and macos, is there any method?
Whether i should include some lib in windows development and then compile as jar
Is there any way?

Thanks

Question information

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

I guess you mean macOS (before named Mac OSX).

If you are talking about SikuliX version 2.1.0: yes, on Mac and Linux (as from beginning), you have to provide the OpenCV libraries yourself.

If you do Java development on Windows, then the compiled jar will work on macOS as well.
If you have native libraries, that are specific for Windows and Mac (as with OpenCV), then you have to either pack the libraries with the jar (as SikuliX 2.1.0 does for Windows) or you have to take care, that the libraries are ready on the running system at the time your jar is used.

If you want to know, how this is done: feel free, to look into the sources of SikuliX.

Revision history for this message
larryli (larryli2020) said :
#2

Do you mean If i compiled as jar in windows, it can work on macos also even if i use V2.1?

As current checking, I compiled one jar, but it can not work, it needs opencv lib, whether it is same with you?

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

As mentioned: on macOS to run SikuliX 2.1.0, you need to install the OpenCV libraries before:
brew install opencv

Revision history for this message
larryli (larryli2020) said :
#4

Sorry, I am not so familiar with macos environment, brew install opencv will not include opencv

So if i run it on macos, which compiled jar in windows, no need compile for mac, is it right? Just install environment, it can work normally

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

If you want to get familiar with macOS, then use SikuliX 2.0.4 - it is ready for use on macOS (opencv libs included)

I do not recommend to use 2.1.0 anyways: it is under heavy development and far from stable.

Revision history for this message
larryli (larryli2020) said :
#6

Thanks for your information
I can understand

Revision history for this message
larryli (larryli2020) said :
#8

Dear RaiMan

sorry to ask question again.
In my side, I set pom.xml as the following according to your document.
<dependency>
  <groupId>com.sikulix</groupId>
  <artifactId>sikulixapi</artifactId>
  <version>2.0.4</version>
</dependency>

and then I compiled sikulix in the local, I use local build API to replace 2.0.4 API lib in java project
and then make one Jar application for java project.
after that, I copy this jar to macos, it can not work, it will have the following issue.

[error] RunTime:loadLib: libopencv_java.dylib (failed) probably dependent libs missing:

it is same with your information in the following page.
https://github.com/RaiMan/SikuliX1/wiki/macOS-Linux:-Support-Libraries-for-OpenCV-4

but in my side, I already use brew install opencv command to install.

is there any special setting? which point has problem?

thank you very much.

Revision history for this message
larryli (larryli2020) said :
#9

additional information. I can see file.jar\sikulixlibs\mac\libs64\libopencv_java.dylib

Revision history for this message
larryli (larryli2020) said :
#10

sorry, already fix
it should resetup artifact again, because, it will use old version.
thanks