Use ImageMagick and centos7imagemagick to install the latest Jmagick 6.7.7 on Centos7.
1. install the environment yum install autoconf ImageMagick-devel.
C ++ class library is required.
Java header files are required for compiling so files, so openjd must be installed.
Yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel
2. Install Jmagick
The official website is no longer updated, and only one github project is being maintained.
Https://github.com/techblue/jmagick
Installation document:
Https://github.com/techblue/jmagick/blob/master/INSTALL
It seems that there is a problem with git cloning. Download the zip package directly.
The wget https://github.com/techblue/jmagick/archive/master.zipunzip jmagick-master.zipcd jmagick-masterautoconf./configure-with-java-home =/usr/java/default
Make allmake install
All the compilation and installation work is fine, and then the jar package and so files are under lib. In fact, it has been installed in/usr/local/lib/
-Rwxr-xr-x. 1 root 27609 Nov 27 jmagick-6.7.7.jar
-Rwxr-xr-x. 1 root 146606 Nov 27 libJMagick-6.7.7.so
Lrwxrwxrwx. 1 root 21 Nov 27 libJMagick. so->./libJMagick-6.7.7.so
3. tomcat startup Problems
You must add parameters when starting tomcat. Otherwise, initialization fails.
Java. lang. NoClassDefFoundError: cocould not initialize class magick. ImageInfo
Solution: Modify tomcat startup.
Modify catalina. sh and add the parameter after the annotation.
JAVA_OPTS = "-Djava. library. path =/usr/local/lib-Djmagick. systemclassloader = no-server-XX: PermSize = 256 M-XX: MaxPermSize = 1024 m-Xms512M-Xmx1024M-XX: MaxNewSize = 256 m"
Reference blog: http://shengren-wang.iteye.com/blog/1167862
4. Installation Package
The most important thing is the so file. If it has been compiled, you can copy the so file to other servers, instead of compiling it.