2

My Eclipse installation doesn't have any issues when I'm running the project but if i exported the same as runnable jar file then I'm getting an exception as follows:

Exception in thread "Thread-2" java.util.ServiceConfigurationError: javax.imageio.spi.ImageReaderSpi: Provider com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReaderSpi could not be instantiated
            at java.util.ServiceLoader.fail(Unknown Source)
            at java.util.ServiceLoader.access$100(Unknown Source)
            at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source)
            at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
            at java.util.ServiceLoader$1.next(Unknown Source)
            at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(Unknown Source)
            at javax.imageio.spi.IIORegistry.<init>(Unknown Source)
            at javax.imageio.spi.IIORegistry.getDefaultInstance(Unknown Source)
            at javax.imageio.ImageIO.<clinit>(Unknown Source)
            at emiratesid.ae.sample.MainFrame.displayPublicData(MainFrame.java:837)
            at emiratesid.ae.sample.MainFrame.loadPublicData(MainFrame.java:754)
            at emiratesid.ae.sample.MainFrame$PublicDataThread.run(MainFrame.java:1267)
            at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.IllegalArgumentException: vendorName == null!
            at javax.imageio.spi.IIOServiceProvider.<init>(Unknown Source)
            at javax.imageio.spi.ImageReaderWriterSpi.<init>(Unknown Source)
            at javax.imageio.spi.ImageReaderSpi.<init>(Unknown Source)
            at com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReaderSpi.<init>(CLibJPEGImageReaderSpi.java:80)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at java.lang.Class.newInstance(Unknown Source)
            ... 11 more
    Exception in thread "Thread-3" java.lang.NoClassDefFoundError: Could not initialize class javax.imageio.ImageIO
            at emiratesid.ae.sample.MainFrame.displayPublicData(MainFrame.java:837)
            at emiratesid.ae.sample.MainFrame.loadPublicData(MainFrame.java:754)
            at emiratesid.ae.sample.MainFrame$PublicDataThread.run(MainFrame.java:1267)
            at java.lang.Thread.run(Unknown Source)

Did anyone gone through this kind of exception. Seeking help.

MWiesner
  • 8,868
  • 11
  • 36
  • 70
Ibin Joy
  • 21
  • 6

1 Answers1

0

Could you compile the below class and run it as java -cp your_runable.jar:. Check.

public class Check {
    public static void main(String[] args) {
        System.out.println(
            com.sun.media.imageioimpl.common.PackageUtil.getVendor()
        );
    }
}

The output should be similar to the one from running java -cp jai_imageio-1.1.jar:. Check

Sun Microsystems, Inc.
SubOptimal
  • 22,518
  • 3
  • 53
  • 69