0

Why do I get this error when I try to open a .JAR file from cmd?

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...

1 Answers1

0

I suspect your issue is caused by not including images in your JAR. Please see this question on how to do that: It may be that you don't include images as resources in your JAR. See this question: Add image to JAR Java

Community
  • 1
  • 1
nhouser9
  • 6,730
  • 3
  • 21
  • 42