How to fix Java Image Fetcher error ?
        Posted  
        
            by Frank
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Frank
        
        
        
        Published on 2010-05-22T14:44:33Z
        Indexed on 
            2010/05/22
            14:51 UTC
        
        
        Read the original article
        Hit count: 295
        
My code looks like this :
  private static JFileChooser fc;
  if (fc==null)
  {
    fc=new JFileChooser(Image_Dir);  
    fc.addChoosableFileFilter(new Image_Filter());  // Add a custom file filter and disable the default (Accept All) file filter.
    fc.setAcceptAllFileFilterUsed(false);
    fc.setAccessory(new Image_Preview(fc));         // Add the preview pane.
  }
  int returnVal=fc.showDialog(JFileChooser_For_Image.this,"Get Image");         // Show it.
After I select an image from the panel, I got the following error message :
Exception in thread "Image Fetcher 0" java.lang.UnsatisfiedLinkError: Native Library C:\Program Files (x86)\Java\jre6\bin\jpeg.dll already loaded in another classloader
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at sun.security.action.LoadLibraryAction.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.awt.image.JPEGImageDecoder.<clinit>(Unknown Source)
    at sun.awt.image.InputStreamImageSource.getDecoder(Unknown Source)
    at sun.awt.image.FileImageSource.getDecoder(Unknown Source)
    at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
    at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
    at sun.awt.image.ImageFetcher.run(Unknown Source)
When I run it from an executable Jar file, it works fine, but after I wrapped it into an exe file, I got the above error, why ? How to fix it ?
© Stack Overflow or respective owner