简体   繁体   English

执行jar文件时出错

[英]Error while executing jar files

Why do I get this error when I try to open a .JAR file from cmd? 尝试从cmd打开.JAR文件时,为什么会出现此错误?

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at javax.swing.ImageIcon.<init>(Unknown Source)
    at sqlprojectgestor.Gestor.initComponents(Gestor.java:311)
    at sqlprojectgestor.Gestor.<init>(Gestor.java:28)
    at sqlprojectgestor.Gestor.lambda$main$0(Gestor.java:1017)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$500(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

I try to run the .jar file with double click but it won't open... 我尝试双击运行.jar文件,但无法打开...

I suspect your issue is caused by not including images in your JAR. 我怀疑您的问题是由于JAR中未包含图片引起的。 Please see this question on how to do that: It may be that you don't include images as resources in your JAR. 请参见此问题的解决方法:您的JAR中可能没有包含图像作为资源。 See this question: Add image to JAR Java 看到这个问题: 将图像添加到JAR Java

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM