How to fix Exception while generating TIFF image

Contents
[ ]

TIFF images are supported natively by Java from Java 9. However, TIFF images are not supported by Java 8 and older. For TIFF support in old Java environments, Aspose.Cells for Java depends on the Java Advanced Imaging (JAI) package from Oracle. An exception will occur if the JAI package is not available:

NoClassDefFoundError: com/sun/media/imageio/plugins/tiff/TIFFImageWriter

Or a clearer exception in newer Aspose.Cells for Java:

Exception: Please add Java Advanced Imaging (JAI) references to generate TIFF images for Java8 and older!

Solution

  1. Please install JAI for Java 8 and older: How to install JAI
  2. Upgrade to Java 9 and above.