1.sudo apt-get install imagemagick libjmagick6-java
2.在任意目录下建立JavaLibraryPath.java文件,内容如下:
public class JavaLibraryPath{
public static void main(String[] args) throws Exception {
System.out.println(System.getProperty("java.library.path"));
}
}
3.执行:javac JavaLibraryPath.java
4.执行:java JavaLibraryPath可以看到如下内容
/usr/lib/jvm/jdk1.6.0_31/jre/lib/amd64/server:/usr/lib/jvm/jdk1.6.0_31/jre/lib/amd64:/usr/lib/jvm/jdk1.6.0_31/jre/../lib/amd64::/opt/pps/lib:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
5.请将 /usr/lib/jni/libJMagick.so 复制到上面打印现出来的任意目录,我是放在/usr/lib/下的
sudo cp /usr/lib/jni/libJMagick.so /usr/lib/
6.执行sudo chmod 755 /usr/lib/libJMagick.so