Problem: NoClassDefFoundError com.sun.media.jai.codec.SeekableStream

Hi, I have a problem when I execute the save method.

ByteArrayOutputStream dstStream =new ByteArrayOutputStream();
doc.save(dstStream, SaveFormat.PDF);

I use was server 8.5

java.lang.NoClassDefFoundError: com.sun.media.jai.codec.SeekableStream.

Thanks in advance.

Hi,

Thanks for your inquiry. First off, please upgrade to the latest version of Aspose.Words for Java from the following link:
https://releases.aspose.com/words/java

Secondly, it seems you’re missing a necessary JAR file in the classpath. Aspose.Words for Java depends upon the Java Advanced Imaging (JAI) package from Sun in order to process images. In order to write to different image formats you are expected to have the appropriate image reader and writers installed on your development machine. I suggest you please download and install the JAI codec onto your machine. You can find jai 1.1.3 and jai-imageio 1.1 in the following links:

https://docs.aspose.com/words/java/system-requirements/#optional-dependencies

If we can help you with anything else, please feel free to ask.

Best regards,