所以我需要在 StdDraw 的帮助下绘制一些小的 .gif 图片(它必须是 StdDraw),但我遇到了一个非常愚蠢的错误。我的代码是:
while(true){
StdDraw.setXscale(-R,R);
StdDraw.setYscale(-R,R);
StdDraw.picture(0, 0, "starfield.jpg");
}
其中 R 是 Double,starfield.jpg 是背景图片。
我尝试运行时遇到的错误是:
Exception in thread "main" sun.misc.ServiceConfigurationError: javax.imageio.spi.ImageReaderSpi: Provider it.tidalwave.imageio.arw.ARWImageReaderSpi not found
at sun.misc.Service.fail(Service.java:129)
at sun.misc.Service.access$000(Service.java:111)
at sun.misc.Service$LazyIterator.next(Service.java:274)
at javax.imageio.spi.IIORegistry$1.run(IIORegistry.java:224)
at java.security.AccessController.doPrivileged(Native Method)
at javax.imageio.spi.IIORegistry.registerInstalledProviders(IIORegistry.java:232)
at javax.imageio.spi.IIORegistry.registerStandardSpis(IIORegistry.java:167)
at javax.imageio.spi.IIORegistry.<init>(IIORegistry.java:120)
at javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:142)
at apple.awt.CToolkit.registerDefaultServices(CToolkit.java:1346)
at apple.awt.CToolkit.<init>(CToolkit.java:154)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:357)
at java.lang.Class.newInstance(Class.java:310)
at java.awt.Toolkit$2.run(Toolkit.java:859)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:826)
at java.awt.Window.getToolkit(Window.java:1177)
at java.awt.Window.init(Window.java:397)
at java.awt.Window.<init>(Window.java:433)
at java.awt.Frame.<init>(Frame.java:403)
at java.awt.Frame.<init>(Frame.java:368)
at javax.swing.JFrame.<init>(JFrame.java:158)
at StdDraw.init(StdDraw.java:173)
at StdDraw.<clinit>(StdDraw.java:145)
at Sonnensystem.main(Sonnensystem.java:58)
由于这引发了一个非常大的错误,我无法通过谷歌找到任何解决方案,我自己也找不到错误。因此,如果有人能指出我正确的方向,那就太好了!
如本视频所述,我将 stdlib.jar 添加为外部存档:https ://www.youtube.com/watch?v=taJovOCBPS4