[英]Project running in Netbeans 8.0 but not as JAR
I´m really confused, i´m making a small GUI for UI Automation at Work, works perfectly in Netbeans IDE 8.0, no running problems at all! 我真的很困惑,我正在为工作中的UI自动化制作一个小型GUI,可以在Netbeans IDE 8.0中完美运行,根本没有运行问题! But i haven't tried to run the executable jar before and there lies the problem…it isn´t running.
但是我之前没有尝试过运行可执行jar,这就是问题所在……它没有运行。 The JAR starts, but nothing comes up ???
JAR开始,但是什么都没有发生? So i tried du run it via terminal an there is a really long Exception:
所以我尝试通过终端运行它,但有一个很长的例外:
Anyone an idea ? 有人知道吗?
The main cause for a NPE in a jar on the same computer as opposed to a working set of java .class files: 与同一套Java .class文件的工作集不同,同一计算机上的jar中存在NPE的主要原因是:
File
instead of getResource/getResourceAsStream
- a File cannot look in a jar. File
而不是getResource/getResourceAsStream
文件无法在jar中查找。 So do a clean build, look into the jar with WinZip/7zip/NetBeans. 因此,进行干净的构建,使用WinZip / 7zip / NetBeans查看jar。
Check for suspicious sweeps-under-the-carpet: catch (Exception e) { }
. 检查地毯下是否有可打扫物:
catch (Exception e) { }
。
Finally one could look at the error too: the source, and what is done specially with the JList (some component?). 最后,我们也可以看看错误:源代码,以及使用JList(某些组件?)专门进行的操作。 The stack trace shows that it is during the layouting of the JList.
堆栈跟踪显示它在JList的布局期间。 Is it a simple
JList<String>
? 它是一个简单的
JList<String>
吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.