Exception in thread "main" java.lang.NoClassDefFoundError: com.sun.media.jai.codec.SeekableStream
I have been googling, but could not find a solution.
That class is part of the Java Advanced Imaging (JAI) API. You'll have to find out which JAR file(s) you need to use that API and make sure they are in classpath when you compile and run your program.
Campbell Ritchie wrote:Is it safe to use a package beginning com.sun?
You should not use 'sun' or 'com.sun' packages that are inside the JDK; those are not part of the public API of the JDK, and using them makes your program possibly incompatible with future versions of Java.
But here it's about JAI, an external library that's not part of the JDK, and the package com.sun.media.jai.codec is part of the public API of this library, so in this case it's no problem to use classes in this package.
Thank you. I wasn’t sure, and I thought it best to check that this isn’t the cause of the problem.
Jesper de Jong wrote: . . . You should not use 'sun' or 'com.sun' packages that are inside the JDK; . . . But here it's about JAI, an external library that's not part of the JDK, . . .