任何人都可以帮我解决这个错误:
我只是想打开一个图像文件。文件存在且文件路径正确。
try {
BufferedImage img = ImageIO.read(new File(path, "img.jpg"));
....
} catch (Exception e) {e.printStackTrace();}
错误:
Caught and handled this exception :
java.lang.NumberFormatException: For input string: ""
at java.base/java.lang.NumberFormatException.forInputString(Unknown Source)
at java.base/java.lang.Integer.parseInt(Unknown Source)
at java.base/java.lang.Integer.parseInt(Unknown Source)
at com.github.jaiimageio.impl.common.ImageUtil.processOnRegistration(ImageUtil.java:1401)
at com.github.jaiimageio.impl.plugins.wbmp.WBMPImageReaderSpi.onRegistration(WBMPImageReaderSpi.java:96)
at java.desktop/javax.imageio.spi.SubRegistry.registerServiceProvider(Unknown Source)
at java.desktop/javax.imageio.spi.ServiceRegistry.registerServiceProvider(Unknown Source)
at java.desktop/javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(Unknown Source)
at java.desktop/javax.imageio.spi.IIORegistry.<init>(Unknown Source)
at java.desktop/javax.imageio.spi.IIORegistry.getDefaultInstance(Unknown Source)
at java.desktop/javax.imageio.ImageIO.<clinit>(Unknown Source)
at abhi.Abhi.main(Abhi.java:496)