Is there an easy way to detect whether JAI's native binaries are installed?
JAI (Java Advanced Imaging) can run in multiple modes both with and without the native binaries that make it process images faster and also add support for additional formats. But, as the native libraries cannot be installed with Maven, how can you detect whether they're installed in the system?
Documenting solution as it was difficult to find. The OpenGeo (GeoTools) toolkit provides a helper utility for checking whether the libraries are installed via it's ImageUtilities.
In summary:
com.sun.medialib.mlib.Image
com.sun.media.jai.disableMediaLib
com.sun.medialib.mlib.Image
and execute isAvailable()
Code is available via LGPL [ http://svn.osgeo.org/geotools/trunk/modules/library/coverage/src/main/java/org/geotools/resources/image/ImageUtilities.java ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With