使用JAIImageio库,因为(vendorname = null)在运行可执行jar时,在eclipse中正常工作。尝试了所有 可用的链接但没有工作
http://www.java.net/node/677168 http://www.java.net/node/695773
获得这些例外
引起:java.util.ServiceConfigurationError: javax.imageio.spi.ImageReaderSpi:Provider com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReaderSpi可以 实例化:java.lang.IllegalArgumentException:vendorName == 空值! 在java.util.ServiceLoader.fail(未知来源) at java.util.ServiceLoader.access $ 100(未知来源) at java.util.ServiceLoader $ LazyIterator.next(Unknown Source) at java.util.ServiceLoader $ 1.next(Unknown Source) 在javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(未知 n来源) 在javax.imageio.spi.IIORegistry。(未知来源) 在javax.imageio.spi.IIORegistry.getDefaultInstance(未知来源) 在javax.imageio.ImageIO。(未知来源) at net.sourceforge.vietocr.ImageIOHelper.getIIOImageList(ImageIOHelper.j AVA:287) at net.sourceforge.vietocr.ImageIOHelper.mergeTiff(ImageIOHelper.java:34 7) at net.sourceforge.vietocr.PdfUtilities.convertPdf2Tiff(PdfUtilities.jav) 一:43) at net.sourceforge.vietocr.ImageIOHelper.getIIOImageList(ImageIOHelper.j AVA:274) at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:165) at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:150) 在com.hs.TessractExample.main(TessractExample.java:37) ... 5更多引起:java.lang.IllegalArgumentException:vendorName == null! 在javax.imageio.spi.IIOServiceProvider。(未知来源) 在javax.imageio.spi.ImageReaderWriterSpi。(未知来源) 在javax.imageio.spi.ImageReaderSpi。(未知来源) 在com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReaderSpi。( CLibJPEGImageReaderSpi.java:80) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
RCE) at java.lang.reflect.Constructor.newInstance(Unknown Source) 在java.lang.Class.newInstance(未知来源) ......还有18个