I am getting an error running a jmagick app (in this case a test on ubuntu). I've installed the following, but still I get the error below when running the tests
sudo apt-get install imagemagick libmagickcore-dev
sudo apt-get install ghostscript
sudo apt-get install jmagick
when I run a test I get:
Running com.myapp.pdfservice.PdfServiceTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.892 sec <<< FAILURE!
convertPdf(com.myapp.pdfservice.PdfServiceTest) Time elapsed: 1.701 sec <<< ERROR!
java.lang.UnsatisfiedLinkError: magick.Magick.init()V
at magick.Magick.init(Native Method)
at magick.Magick.<clinit>(Magick.java:40)
As I mentioned in the subject, this works fine on OSX, but I'm not sure what I need to do on Ubuntu to make this work.
Any thoughts?
HERE'S THE FIX:
It turned out the apt-get install of jmagick doesn't install the correct libraries to /usr/lib & /usr/lib/jni.
The trick is to download the sources, build and overwrite those installed by apt-get:
svn checkout svn://svn.code.sf.net/p/jmagick/code/trunk jmagick-code
./configure --with-java-home=/usr/lib/jvm/java-7-openjdk-amd64 --with-magick-home=/usr/local/jmagick
make all & make install
sudo cp /usr/local/lib/libJMagick-6.6.9.so /usr/lib/libJMagick.so
sudo cp /usr/local/lib/libJMagick-6.6.9.so /usr/lib/jni/libJMagick.so