Skip to Main Content

Java HotSpot Virtual Machine

Erro with JNI & ImageMagick

843829Sep 8 2010 — edited Sep 11 2010
Hello community.

Sorry for my English, I live in Brazil and my native language is Brazilian Portuguese (pt-br). :-P

I'm trying to use ImageMagick on project in Netbeans. I'm following the tutorial itself JMagick that has the following code:

My code is here:
package metadados.exemplos;
import magick.ImageInfo;
import magick.MagickException;
import magick.MagickImage;
public class Readi {
System.out.println(System.getProperty ("java.library.path"));
//        System.setProperty("java.library.path", System.getProperty ("java.library.path")+":/usr/local/lib:/usr/local/include/");
//        System.out.println(System.getProperty ("java.library.path"));
public static void main(String[] a) throws MagickException{
//        System.out.println(System.getProperty ("java.library.path"));
//        MagickImage image = new MagickImage(new ImageInfo("/home/paulopatto/Imagens/PATTO/bandeira_brasil.jpg"));
//        System.out.println(image.getImageFormat());
And when running this code returns me the following exception:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no JMagick in java.library.path
at java.lang.ClassLoader.loadLibrary(
at java.lang.Runtime.loadLibrary0(
at java.lang.System.loadLibrary(
at univesp.metadados.exemplos.Readi.(
Could not find the main class: metadados.exemplos.Readi.  Program will exit.
But as can be seen the the output from System.getProperty ("java.library.path") returns this path:

Vajam And how is my output with the command ls /usr/lib/J*
the jar JMagick is in my classpath.

I saw here in the other forum posts about this error but no response or incomplete. I'm using the Ubuntu operating system 10.04 and Java 1.6 (JDK 1.6.0_20 SUN)

Other thing that the load library does not work even with the folder where the is to be part of java.library.path .

Anyone have any suggestions on how to solve this problem?

Thank you atention.

Paulo Patto
web developer
paulopatto gmail [dot] com
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 9 2010
Added on Sep 8 2010