[ome-devel] JAI

Curtis Rueden ctrueden at wisc.edu
Tue Jun 16 17:37:01 BST 2015


Hi Douglas,

CCing ome-devel, as this may interest others.

> I'm just trying to use the BFS3 Handler and I'm running into a problem
> with Java Advanced Imaging.

Yeah, unfortunately, JAI is not just a library -- it's a Java platform
extension. This means it installs into the lib/ext folder of your JRE.
Usually this is done because native libraries are installed, too. (The
whole "Java platform extension" thing is so last decade, though... ;-)

Anyway, the reason it works on OS X out of the box is that Apple Java 6
ships with Java 3D and JAI installed in /Library/Java/Extensions. They are
really old versions, but in this case I guess it did the job.

IIRC, the reason JAI is not available from a Maven repo is due to licensing
issues: Java Advanced Imaging is not open source! [1] So redistributing it
from a Maven repo has legal problems.

Actually though, it looks like there _is_ a fork in Maven Central now,
slightly stripped down to avoid said legal issues:
* https://github.com/jai-imageio/jai-imageio-core
*
http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.jai-imageio%22%20AND%20a%3A%22jai-imageio-core%22

So maybe we could update Bio-Formats to use that! The package names are
different so it would require some code changes, though.

Melissa: any ideas on how you'd prefer to address this issue in Bio-Formats
proper?

Regards,
Curtis

[1] https://en.wikipedia.org/wiki/Java_Advanced_Imaging

On Tue, Jun 16, 2015 at 10:21 AM, Douglas Russell <root at dpwrussell.com>
wrote:

> Hi Curtis,
>
> I'm just trying to use the BFS3 Handler and I'm running into a problem
> with Java Advanced Imaging.
>
> 11:04:14.008 [main] INFO  loci.formats.FormatHandler - Checking for JAI
> Exception in thread "main" loci.formats.MissingLibraryException: Java
> Advanced Imaging (JAI) is required to read some TIFF files. Please install
> JAI from https://jai.dev.java.net/
> at loci.formats.in.TiffJAIReader.initFile(TiffJAIReader.java:111)
> at loci.formats.FormatReader.setId(FormatReader.java:1426)
> at loci.formats.DelegateReader.setId(DelegateReader.java:298)
> at loci.plugins.in.ImportProcess.initializeFile(ImportProcess.java:505)
> at loci.plugins.in.ImportProcess.execute(ImportProcess.java:143)
> at loci.plugins.BF.openImagePlus(BF.java:92)
> at loci.plugins.BF.openImagePlus(BF.java:77)
> at edu.harvard.hms.bfs3.Main.main(Main.java:54)
> Caused by: loci.common.ReflectException: No such class:
> javax.media.jai.NullOpImage
> at loci.common.ReflectedUniverse.exec(ReflectedUniverse.java:161)
> at loci.formats.in.TiffJAIReader.initFile(TiffJAIReader.java:104)
> ... 7 more
> Caused by: java.lang.ClassNotFoundException: javax.media.jai.NullOpImage
> at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:348)
> at loci.common.ReflectedUniverse.exec(ReflectedUniverse.java:153)
> ... 8 more
>
> I tried adding a maven dependency for JAI, but it looks like that is not
> in the imagej maven repository. Obviously it worked on your laptop in Paris
> so it must have been there somehow. What do you think the best resolution
> is? My knowledge of Maven is extremely limited as I stopped using Java
> around the time it was really taking off, but I would have thought that
> this could be fixed by adding another maven repository to the pom... but
> it's odd that it worked for you on your laptop without any of that.
>
> Cheers,
>
> Douglas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20150616/86cb04ff/attachment.html>


More information about the ome-devel mailing list