JMagick error while trying to upload file - UnsatisfiedLink

java.lang.UnsatisfiedLinkError: no JMagick in java.library.path in java.lang.ClassLoader.loadLibrary (ClassLoader.java:1754) in java.lang.Runtime.loadLibrary0 (Runtime.java:823) in java.lang.System .loadLibrary (System.java:1045)

when trying to use code

ImageInfo info; try { info = new ImageInfo(); //image = new MagickImage(info); } catch (MagickException e) { logger.error(InsightsHelper.getStackTrace(e)); } 

any ideas why this is happening? I am using eclipse on OSX

+7
java imagemagick jmagick
source share
2 answers

The simple answer is that the JVM tries to find the native library used by JMagick and fails. Either you don’t have a native library at all, or not where the JVM looks for it.


I downloaded the package for osx from here: joggame.com/software/jmagick.html ran configure / make / make install, and everything went well. What else do I need to configure for java to find it?

You need to find out where "make install" installed the native DLL and tell Java to find it in the right place:

  • If you are running from Eclipse, follow the procedure in the trigon response.

  • If you run from the command line directly or through a script, then you need to include this option (or its equivalent) in the java command:

      java -Djava.library.path=/some/folder/ .... 

    Note that this is a JVM parameter and must go before the class name.

+2
source share

You need to add the binaries that you compiled so that Eclipse can see it. First add JMagick.jar as a library, then in the project properties → Java build path → Libraries, you click on the jmagick jar that you added to this project and edit the location for the “Native library”, which in this case will be where libJMagick -6.2.6.dylib is found since that says the link you provided.

+2
source share

All Articles