I am running into errors such as the following:
Exception in thread "Thread-1" java.lang.IncompatibleClassChangeError:
Found class com.sun.image.codec.jpeg.JPEGImageEncoder, but interface
was expected
I have built my JAR's using Sun JDK and I am running on OpenJDK. I am kind of stuck with this environment.
Is there an easy way around this? Do I have to compile and run the code on OpenJDK?
解决方案
By the looks of it, Jasper Reports is drilling down and using internal classes / methods that it shouldn't use. This apparently doesn't work on all platforms ... which is not surprising because Sun / Oracle specifically state that doing this is liable to break.
What should you do?
Check the Supported Platforms datasheet. I note that it lists OpenJDK 6, but not OpenJDK 7. Maybe you should stick with the JasperSoft supported platforms.
I found this page which seems to talk about this problem ... or something rather similar ... and offers a workaround.