JMagick setup problems with Eclipse in OS X - UnsatisfiedLinkError: no JMagick in java.library.path

7.7k views Asked by At

I am having some trouble setting up my environment in Eclipse for ImageMagick via JMagick in OS X. I have no problems using the ImageMagick command line tools (display, convert, etc.) after installing, but am unable to set up JMagick with a Java project in Eclipse.

Steps taken:

  1. Downloaded JMagick 6.4.0
  2. Generated jar and libs through make process in the INSTALL document
  3. Copied libJMagick.so and libJMagick-6.4.0.so from lib to /usr/lib/java
  4. Added JMagick.jar to build path
  5. Linked /usr/lib/java directory to JMagick.jar native source, recommended in the solution posted by trigoman at the following url: JMagick Error when trying to load a file - UnsatisfiedLink
  6. Created sample class that accesses JMagick and attempted to run in Eclipse. Exception reported:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no JMagick in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1758)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1045)
at example.ImageRender.main(ImageRender.java:10)

Does anyone have any ideas what might be the underlying problem is?

1

There are 1 answers

4
fith On BEST ANSWER

edit: see my comment below about using im4java instead of JMagick.

I was having the same problem, but just got it working by following these sparse instructions: http://wesleyli.blog.com/2011/09/01/install-jmagick-on-mac/

But note there's a couple typos; looks like Lion auto-correct problems. So what I did was:

svn co https://jmagick.svn.sourceforge.net/svnroot/jmagick jmagick
cd jmagick/trunk
./configure --with-java-home=/System/Library/Frameworks/JavaVM.framework/Versions/Current --with-magick-home=/usr/local/jmagick
sudo make all & sudo make install
sudo ln -s /usr/local/lib/libJMagick-6.5.7.so /Library/Java/Extensions/libJMagick.jnilib

And now it works for me. :)