JAI图像处理环境的搭建

1. How can I  get the JAI lib files?

https://jai.dev.java.net/binary-builds.html

I download the jai-1_1_3-lib-linux-i586.tar.gz according to my os.

 

2. The details of the lib

 

jar files:
jai_core.jar: containing core JAI class files.  required 
jai_codec.jar: JAR file containing JAI class files for doing I/O on some image formats. It is worth to point out that this so-called CODECS load and store images in various formats are deprecated in favour of using ImageIO extensions.  required 
mlibwrapper_jai.jar:JNI interfaces for exploiting native mediaLib.  required 

 

native lib:
libmlib_jai.so: mediaLib JNI shared libraries, C version.  Linux 


3. The discription of classpath and native lib use.

(1) Put the three jar files to the classpath.
(2) In case you see a warning message like the following when running your application: 

Error: Could not load mediaLib accelerator wrapper classes. Continuing in pure Java mode.

Occurs in: com.sun.media.jai.mlib.MediaLibAccessorcom.sun.media.jai.mlib.MediaLibLoadException

his means that you did not install properly the native libraries and then JAI is working in pure JAVA mode.

 

4. How to let native lib work.

$JAIDIR     is the directory into which the JAI files are to be installed

Set CLASSPATH as follows:

% setenv JAIHOME $JAIDIR/jai-1_1_3/lib
% setenv CLASSPATH $JAIHOME/jai_core.jar:$JAIHOME/jai_codec.jar:$JAIHOME/mlibwrapper_jai.jar:$CLASSPATH
% setenv LD_LIBRARY_PATH .:$JAIHOME:$CLASSPATH

 

 

reference:

1. http://java.sun.com/products/java-media/jai/INSTALL.html

2. http://docs.codehaus.org/display/GEOT/Manual+JAI+Installation

你可能感兴趣的:(java,.net,linux,jni,sun)