Eclipse exported Runnable JAR not showing images

DeNitE Appz

My images will not load when running a JAR file exported from Eclipse.

I have the images in a resources class package. I've tried a images source folder as well with no luck.

Works perfectly when loaded from Eclipse. The images are in the exported JAR file, so they're exporting fine.

I've tried:

label.setIcon(new ImageIcon(MainFrame.class.getResource("/resources/header.jpg")));

I've also tried:

URL url = getClass().getResource("/resources/header.jpg");
Image image = Toolkit.getDefaultToolkit().getImage(url);
label.setIcon(new ImageIcon(image));

And:

try
{
    label.setIcon(new  ImageIcon(ImageIO.read(getClass().getResource("/resources/header.jpg"))));
}
catch (IOException e1)
{
    e1.printStackTrace();
}

Any suggestions?

DeNitE Appz

The problem was I had this project in my Windows profile... that had an "!" in it... (DeNitE! -> was the name of my Windows profile)

As soon as I changed it to DeNitE (without the !) it worked fine...

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Exported eclipse runnable .jar will not run

From Dev

Java eclipse error with exported runnable jar file

From Dev

Java project working on Eclipse but not working when exported to runnable jar file

From Dev

Different behavior in JAR file vs Runnable JAR file exported from Eclipse

From Dev

Java - program works perfectly in eclipse but does not seem to do its intended task when exported to runnable jar

From Dev

Eclipse exported Runnable Jar fails througing java.lang.UnsatisfiedLinkError exception

From Dev

Eclipse export to runnable .jar

From Dev

Loading images in the exported .jar file

From Dev

OpenCV Exporting Runnable JAR in Eclipse

From Dev

JavaFX Project breaks when exported to runnable .jar? FXMLLoader related?

From Dev

DynamicReports won't work when exported to a runnable jar

From Dev

Exported JAR file does not show images

From Dev

Images not loaded when exporting to runnable jar

From Dev

Images not loaded when exporting to runnable jar

From Dev

Exporting java project to runnable jar file with images

From Dev

UnsatisfiedLinkError in exported (Eclipse) executable jar file

From Dev

InvalidInputException when running a jar exported from Eclipse

From Dev

how to execute a runnable jar file in eclipse

From Dev

Deploying a runnable jar in ECLIPSE by considering dependencies

From Dev

Eclipse: Create Runnable .jar WITH manifest possible?

From Dev

Exporting Runnable JAR in eclipse with User Libraries included

From Dev

Java project runs properly in command line (exported jar), but not using Eclipse

From Dev

Runnable jar runs too slow compared to eclipse project

From Dev

Eclipse's "Export Runnable JAR" and Maven's "package" command

From Dev

How to make the runnable jar file for a maven eclipse project with hibernate configuration

From Dev

How do I create a runnable JAR in IntelliJ as I would in Eclipse

From Dev

Eclipse Java9 Export Runnable JAR file

From Dev

how to make runnable jar for javaCV or openCV project from Eclipse

From Dev

Eclipse not finding main method when trying to export to runnable JAR

Related Related

  1. 1

    Exported eclipse runnable .jar will not run

  2. 2

    Java eclipse error with exported runnable jar file

  3. 3

    Java project working on Eclipse but not working when exported to runnable jar file

  4. 4

    Different behavior in JAR file vs Runnable JAR file exported from Eclipse

  5. 5

    Java - program works perfectly in eclipse but does not seem to do its intended task when exported to runnable jar

  6. 6

    Eclipse exported Runnable Jar fails througing java.lang.UnsatisfiedLinkError exception

  7. 7

    Eclipse export to runnable .jar

  8. 8

    Loading images in the exported .jar file

  9. 9

    OpenCV Exporting Runnable JAR in Eclipse

  10. 10

    JavaFX Project breaks when exported to runnable .jar? FXMLLoader related?

  11. 11

    DynamicReports won't work when exported to a runnable jar

  12. 12

    Exported JAR file does not show images

  13. 13

    Images not loaded when exporting to runnable jar

  14. 14

    Images not loaded when exporting to runnable jar

  15. 15

    Exporting java project to runnable jar file with images

  16. 16

    UnsatisfiedLinkError in exported (Eclipse) executable jar file

  17. 17

    InvalidInputException when running a jar exported from Eclipse

  18. 18

    how to execute a runnable jar file in eclipse

  19. 19

    Deploying a runnable jar in ECLIPSE by considering dependencies

  20. 20

    Eclipse: Create Runnable .jar WITH manifest possible?

  21. 21

    Exporting Runnable JAR in eclipse with User Libraries included

  22. 22

    Java project runs properly in command line (exported jar), but not using Eclipse

  23. 23

    Runnable jar runs too slow compared to eclipse project

  24. 24

    Eclipse's "Export Runnable JAR" and Maven's "package" command

  25. 25

    How to make the runnable jar file for a maven eclipse project with hibernate configuration

  26. 26

    How do I create a runnable JAR in IntelliJ as I would in Eclipse

  27. 27

    Eclipse Java9 Export Runnable JAR file

  28. 28

    how to make runnable jar for javaCV or openCV project from Eclipse

  29. 29

    Eclipse not finding main method when trying to export to runnable JAR

HotTag

Archive