Mesmo erro.
paulopatto@paulopatto-workstation:~/Download/magick/JMagick-6.2.6-0$ ./configure --with-java-home=/usr/lib/jvm/java-6-sun/ --with-java-includes=/usr/lib/jvm/java-6-sun/include/:/usr/lib \--with-magick-inc-dic=/home/paulopatto/Download/magick/ImageMagick-6.6.0-10/
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for a BSD-compatible install... /usr/bin/install -c
checking for getconf... /usr/bin/getconf
checking whether large file support needs explicit enabling... yes
checking for X... libraries , headers
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking jni.h usability... yes
checking jni.h presence... yes
checking for jni.h... yes
checking for java... /usr/bin/java
checking for javac... /usr/bin/javac
checking for javah... /usr/bin/javah
checking for jar... /usr/bin/jar
checking for javadoc... /usr/bin/javadoc
checking for Magick-config... /usr/local/bin/Magick-config
checking magick/api.h usability... no
checking magick/api.h presence... no
checking for magick/api.h... no
configure: error: 'Unable to find ImageMagick header files'
Já tentei baixar o Jar do JMagick (ou seja desistir de compilar), mas ai olha o erro:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no JMagick in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at magick.MagickLoader.<clinit>(MagickLoader.java:13)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at magick.Magick.<clinit>(Magick.java:21)
at univesp.metadados.exemplos.Readi.main(Readi.java:14)
Java Result: 1
package metadados.exemplos;
import magick.ImageInfo;
import magick.MagickException;
import magick.MagickImage;
public class Readi {
public static void main(String[] a) throws MagickException{
MagickImage image = new MagickImage(new ImageInfo("/home/paulopatto/Imagens/PATTO/bandeira_brasil.jpg"));
System.out.println(image.getImageFormat());
}
}
Tá pode reclamar que há não tem a lib do ImageMagick, bem eu fiz o seguinte:
paulopatto@paulopatto-workstation:/usr/lib$ sudo ln /home/paulopatto/Download/magick/jmagick-linux-6.4.0-Q32/libJMagick-6.4.0.so JMagick.so
paulopatto@paulopatto-workstation:/usr/lib$ sudo ln /home/paulopatto/Download/magick/jmagick-linux-6.4.0-Q32/libJMagick-6.4.0.so JMagick
Criar uma cópia da lib do ImageMagick no ext da JVM:
paulopatto@paulopatto-workstation:~/Desenvolvimento$ sudo cp /home/paulopatto/Download/magick/jmagick-linux-6.4.0-Q32/jmagick-6.4.0.jar /usr/lib/jvm/java-6-sun-1.6.0.20/ext
Modeifiquei o código java para isso:
package univesp.metadados.exemplos;
import magick.ImageInfo;
import magick.MagickException;
import magick.MagickImage;
public class Readi {
public static void main(String[] a) throws MagickException{
System.out.println(System.getProperty ("java.library.path"));
System.setProperty("java.library.path", System.getProperty ("java.library.path")+":/usr/local/lib/");
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());
}
}
E a saída:
/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/i386/client:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/i386:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/i386/client:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/i386:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib:/usr/local/lib/
Exception in thread "main" java.lang.UnsatisfiedLinkError: no JMagick in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at magick.MagickLoader.<clinit>(MagickLoader.java:13)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at magick.Magick.<clinit>(Magick.java:21)
at univesp.metadados.exemplos.Readi.main(Readi.java:14)
Java Result: 1
Sinceramente não estou vendo o por que deste erro. Já não sei mais o que fazer…