3 Replies Latest reply on Oct 24, 2012 10:00 PM by 969999

    JAI Installation Trouble on Windows 7

      I am having trouble getting Java to recognize the JAI TIFF codec.

      I'm running Windows 7 64-bit.

      I have installed JDK and JRE 1.6.0_37, both 64-bit and 32-bit versions and confirmed that all four work:
      C:\>"\Program Files\java\jdk1.6.0_37\jre\bin\java.exe" -version
      java version "1.6.0_37"
      Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
      Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)

      C:\>"\Program Files (x86)\java\jdk1.6.0_37\jre\bin\java.exe" -version
      java version "1.6.0_37"
      Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
      Java HotSpot(TM) Client VM (build 20.12-b01, mixed mode, sharing)

      and ditto for
      C:\>"\Program Files\java\jre6\bin\java.exe" -version
      C:\>"\Program Files (x86)\java\jre6\bin\java.exe" -version

      I am running the following code:
                String n[] = ImageIO.getReaderFormatNames();
                for (int i = 0; i < n.length; i++)
                     System.out.println(n [ i ] );

      With no JAI installed, all four installations generate the same list: jpg,BMP,bmp,JPG,wbmp,jpeg,png,PNG,JPEG,WBMP,GIF,gif. Note the expected lack of TIFF support in the standard Java installation.

      For the 32-bit version, I have successfully installed jai-1_1_3-lib-windows-i586-jre.exe and jai-1_1_3-lib-windows-i586-jdk.exe and verified that the expected jai_core.jar, etc., and native acceleration DLLs are correctly installed in jre\lib\ext and jre\bin respectively. For the 64-bit version, I have manually copied just the jai_core.jar and jai_codec.jar files in jre\lib\ext (for both the JDK's JRE and the plain JRE -- no 64-bit native support is available).

      In all of these cases, the code above generates the same list, with no listed TIFF support. I can see the TIFF classes in jai_codec.jar. Any ideas why these wouldn't be picked up by the VM?

      I have also tried manually including the JAI jar files in my classpath and explicitly putting the JRE's bin directory at the front of my PATH (for the 32-bit version) with no success.

      Any suggestions as to what is going wrong with my installation?

      (I tried uninstalling all Java and JAI installations and building up from scratch with identical results.)

      This all works fine with the 1.4 version of JAI: jai_imageio.jar, but that's from 2006.

      Advice/experiences appreciated.


      Edited by: 966996 on Oct 22, 2012 1:37 PM
        • 1. Re: JAI Installation Trouble on Windows 7
          JAI is not the same as ImageIO or JAI-ImageIO.

          This page: http://www.oracle.com/technetwork/java/javase/index-142648.html (link works as of 10/23/2012) contains an explanation. (Unfortunately, most of the links from Oracle's JAI web pages go nowhere.) In short: JAI is a project, now under java.net, for imaging technologies. ImageIO, also under java.net, is a separate project for integrating imaging technologies into the ImageIO framework built into Java SE.

          There is a subproject under ImageIO, called jai-imageio that provides JAI-like functionality in the ImageIO framework. Unfortunately, the java.net projects also don't contain much in the way of explanation or documentation -- the wikis are all empty, for example -- and most of the links are broken (e.g., from http://download.java.net/media).

          As of 10/23/2012, the latest release version of jai-imageio (http://download.java.net/media/jai-imageio/builds/release/) is 1.1, from 10/17/2006. The latest release of JAI (http://download.java.net/media/jai/builds/release/) is 1.1.3, from 10/18/2006.

          Sadly, all these projects appear to be dormant on java.net. There's basically no activity for several years and no releases since the projects were created.

          I am posting here for the benefit of others who may be confused about the status. If anyone has more up-to-date info, please reply.
          • 2. Re: JAI Installation Trouble on Windows 7
            You're basically repeating what many people have said before, but its always good to keep the information fresh :)

            Yep the projects have been "donated" to the community (even before Oracle came into the picture) and the community has not done anything with it, hence they have turned into stale APIs that are slowly dropping off of the internet because nobody really uses them anymore. Unfortunately the documentation behind jai is one of the many casualties of the Sun to Oracle website migration.

            Your quest now is to google "java jai alternative". This for example turned up Apache Commons Sanselan:


            Because guess what:


            tiff support, although not 100%. And of course another API without further development for a few years...
            • 3. Re: JAI Installation Trouble on Windows 7
              Thanks, gimbal2. I found a lot of bad information by searching, and it took me a while to distill this, so I figured it was worth a post.

              Thanks for the link to Sanselan; I found that one as well as a few others, with varying licenses and update schedules. Nothing perfect, of course. For commercial organizations there also appear to be a number of reasonable options at relatively low (but non-zero) cost.