How To Install Java Libraries On Mac

The process for Mac is a bit different, so you can scroll down the Remove Java on Mac section if you are running OS X. Note that the newer versions of Java (Java 8v20 and higher) have a built-in tool for uninstalling older Java versions automatically, but sometimes even this tool doesn’t get rid of everything.

How To Install Java Libraries On Mac Windows 10

This information applies to:

  • Linux with SikuliX 2.0.x
  • Mac and Linux with SikuliX 2.1.0-SNAPSHOT (builds #400+, snapshots from 2019-10-21+)

If you got here automatically, then you have tried to use one of the SikuliX image search or text OCR features and got an error telling you, that the library libopencv is missing or has problems with dependencies.

In the IDE it looks something like this:

The reason behind: The native libraries of the OpenCV package are no longer bundled with SikuliX, but have to be installed on macOS and Linux by the SikuliX user himself.

With SikuliX 2.1.0+ you need the libraries OpenCV version 4.1.x or later

OpenCV for macOS

A little background: Only the library opencv_java.dylib (bridge from Java to the openCV feature libraries) is bundled as a convenience, since currently in the net it is not available ready to install and is a bit complex to create. So only the openCV feature libraries have to be installed by the SikuliX user himself.

Recommendation: install Homebrew as package manager, which should not make any problems on recent macOS versions (tested with success on macOS 10.13+).

How To Install Java Libraries On Mac Download

Get the OpenCV package installation by just running this in a Terminal window:

brew install opencv

After successful installation of opencv, try again with SikuliX.

How to install java libraries on mac download

This might work as well with other package managers like MacPorts, Finch, ..., but is not tested.

... and of course you can do it by building from the sources.

OpenCV for Linux

You have to check, wether for your Linux flavour a package OpenCV is available, that provides the needed libraries. Make sure a link to the libopencv_java.so is available in your loader path at runtime.

In doubt you have to provide it by building from the sources.

Mac Install Java 1.8

For SikuliX 2.1.0+ you need the OpenCV version 4.1.x (or later). Currently there are no prebuilt packages available, so you have to build from source.You might follow the before mentioned instructions or search the net.