JackJiang2011 / beautyeye

BeautyEye is a Java Swing cross-platform look and feel.
http://www.52im.net/forum-86-1.html
Apache License 2.0
1.49k stars 415 forks source link

打包后提示报错。在idea和eclipse中直接运行正常,注释beautyeye代码再打包则正常运行。 #14

Open zxj5470 opened 6 years ago

zxj5470 commented 6 years ago

在ide中运行正常……使用gradle打包后运行报错。 java -jar geotools-jgsk-all-1.0.jar

Exception in thread "main" java.util.ServiceConfigurationError: javax.imageio.spi.ImageOutputStreamSpi: Provider com.sun.media.imageioimpl.stream.ChannelImageOutputStreamSpi 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 org.jb2011.ninepatch4j.GraphicsUtilities.loadCompatibleImage(GraphicsUtilities.java:17)
        at org.jb2011.ninepatch4j.NinePatch.load(NinePatch.java:53)
        at org.jb2011.lnf.beautyeye.utils.NinePatchHelper.createNinePatch(NinePatchHelper.java:41)
        at org.jb2011.lnf.beautyeye.ch4_scroll.__Icon9Factory__.getResource(__Icon9Factory__.java:51)
        at org.jb2011.lnf.beautyeye.ch4_scroll.__Icon9Factory__.getResource(__Icon9Factory__.java:1)
        at org.jb2011.lnf.beautyeye.utils.RawCache.getRaw(RawCache.java:48)
        at org.jb2011.lnf.beautyeye.ch4_scroll.__Icon9Factory__.getRaw(__Icon9Factory__.java:62)
        at org.jb2011.lnf.beautyeye.ch4_scroll.__Icon9Factory__.getScrollPaneBorderBg(__Icon9Factory__.java:213)
        at org.jb2011.lnf.beautyeye.ch4_scroll.ScrollPaneBorder.<init>(ScrollPaneBorder.java:33)
        at org.jb2011.lnf.beautyeye.ch4_scroll.__UI__.uiImpl(__UI__.java:39)
        at org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.implLNF(BeautyEyeLNFHelper.java:184)
        at org.jb2011.lnf.beautyeye.BeautyEyeLookAndFeelWin.<init>(BeautyEyeLookAndFeelWin.java:54)
        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)
        at javax.swing.UIManager.setLookAndFeel(Unknown Source)
        at org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF(BeautyEyeLNFHelper.java:275)
        at top.cuggis.geotools.utils.ZhMapLoader.initMap(ZhMapLoader.java:25)
        at top.cuggis.geotools.Main.main(Main.java:29)
Caused by: java.lang.IllegalArgumentException: vendorName == null!
        at javax.imageio.spi.IIOServiceProvider.<init>(Unknown Source)
        at javax.imageio.spi.ImageOutputStreamSpi.<init>(Unknown Source)
        at com.sun.media.imageioimpl.stream.ChannelImageOutputStreamSpi.<init>(ChannelImageOutputStreamSpi.java:64)
        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)
        ... 28 more

在idea和eclipse中直接运行正常。 将前三行代码注释后在打包也能够正常运行……

zxj5470/geotools-jgsk...ZhMapLoader.java

    public static void initMap() throws Exception {
        BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.osLookAndFeelDecorated;
        UIManager.put("RootPane.setupButtonVisible", false);
        BeautyEyeLNFHelper.launchBeautyEyeLNF();

        ZhJMapFrame frame=Main.frame;
        frame.setTitle("GeoTools");
//.....
    }

项目地址;https://github.com/zxj5470/geotools-jgsk

ice1000 commented 6 years ago

The corresponding StackOverflow question: https://stackoverflow.com/questions/47725707/why-beautyeye-causes-mysterious-bug-as-a-jar