安装jmagick

来源:http://www.rabuser.info/jmagick.php#english

更多内容链接:http://sourceforge.net/apps/mediawiki/jmagick/index.php?title=Installing_JMagick

This tutorial copes with setting up JMagick on Windows and Linux OS to use the ImageMagick Engine within Java Applications or Servlets. The examples are tested with Windows XP and Ubuntu. Other distributions may require little adaptions. Sun Java 1.6 will be used on both sample machines.

ImageMagick:

Windows Users may download the binaries first: exe und dll installer can be found at: http://imagemagick.org/script/binary-releases.php Linux User might prefer the sources, because I worry about most of the binary installs failing because of gcc versioning conflicts. That's why we download the source codde from: http://imagemagick.org/script/install-source.php#unix (ImageMagick.tar.gz) As You can see there, You can install it within the Shell this way:

#wget http://...Url to ImageMagick.tar.gz
tar xvfz ImageMagick.tar.gz
cd ImageMagick-*
./configure
make
make install
make check
With the newest Sources (February, 2009) no error came up.

JMagick:

Next, we install JMagic, which requires ImageMagick. You can describe JMagick as wrapper to provide the Objects - originally written in C - for Java developers. Look for jmagick-win-*-Q16.zip at http://downloads.jmagick.org/ to download and unpack. For Linux on the same page the source coddes cam ne found: jmagick-*-src.tar.gz is our candidate. Lets define the Java Paths for the bash before continueing.

export JAVA_HOME=/usr/lib/jvm/java-6-sun/bin/java
export PATH=$PATH:/usr/lib/jvm/java-6-sun/bin
In the case of ./configure failing, see the alternative below.
#wget ...jmagick...tar.gz
tar xvfz jmagick*.tar.gz
cd JMagick*
./configure
make all
make install
Alternative for ./configure:  ./configure --prefix=/usr/local/jmagick --with-java-home=/usr/lib/jvm/java-6-sun/ --with-java-includes=/usr/lib/jvm/java-6-sun/include/:/usr/lib/jvm/java-6-sun/include/linux/ 
In wonder about make skipping jobs though errors are shown, which happens to me when compiling older versions. However, the same binaries worked on my system. Like some board suggest, we may look for the .so libraries manually and copy it (sudo) to /usr/lib/ to make sure, Java is able to find them. You also have to copy the jmagick.tar to the lib directory of TomCat and Java. With Windows we look for JMagick.dll and make sure, it's path directory is listed in Windows Systems $PATH. Edit and look it up: Start; Control Panel; System; Advanced; Environment Variables Additionally, we copy the file jmagick.jar to C:\Programme\Java\jre6\lib and the jmagick.dll to C:\Programme\Java\jdk1.6.0_12\bin

Usage:

Although we copied the binaries and .jar into the right directories, I suggest to add the jmagick.jar to the Java (Servlet) Application Project and add this line to Your java-Source Code: System.setProperty("jmagick.systemclassloader", "no");

Although ImageMagick itself is documented properly, the JMagick Wiki is very poor. Examples are missing, too, for lots of methods, JMagick provides. At the moment I am developing an application for graphics and image manipulation. It's not Open Source, but let me help You with experience.

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

http://boristechnicalnotes.blogspot.com/2008/10/installing-jmagick-639-on-windows-xp.html



Monday, October 27, 2008

Installing JMagick 6.3.9 on Windows XP

Here are the steps:

1. Go to http://downloads.jmagick.org/6.3.9/.
2. Download ImageMagick-6.3.9-0-Q16-windows-dll.exe and install. The PATH environment variable should be updated with the install directory.
3. Download jmagick-win-6.3.9-Q16.zip and unzip. The directory contains jmagick.jar and jmagick.dll. You may move both files subject to #4 and #5.
4. Make sure jmagick.jar is in the Java classpath.
5. Make sure your VM arguments (e.g. in Eclipse or from the command line) contain a pointer to the directory containing jmagick.dll. E.g. -Djava.library.path=C:/dcs/tools/jmagick-win-6.3.9-Q16.

你可能感兴趣的:(java,java,java,图片,jmagick)