JAR files with images

已回答

Hey im working on a Java Swing project and i have images and gifs in it. When im trying to create a jar file, its getting created but when i try to run it, it actually get me to an error which says 'jar file is corrupted or something'. Can anyone help me with this?

0

Hi @Atharva Barge, can you share more info, on how you create the jar file and the full log of the exception? Steps to reproduce and screenshots or screencast of the issue would be highly appreciated.

0

As the other articles said, I firstly navigated to project architecture and then created a JAR artifact and included the main class and all the images and then build the project and then i build the artifact. The jar file is getting created now but no images are getting displayed on the jar file after executing. And when i use the getResource method, its throwing me an exception. Its creating a lot of trouble for me.

0

Hi @Atharva Barge, can you provide the link to one of such articles?

There are two questions:

1. Is the generated JAR artifact contains any images?

2. If yes, what's the code of the getResource() call? Is it like this:

java.net.URL classUrl = MyClass.class.getResource(
"images/xx.gif");

The full exception log might helps me a lot.

0

Can't we just connect through anydesk? it would make it easier for both of us. You can DM me on WhatsApp at +91 7558546621.
Thank you.

0

I'm sorry we didn't provide a remote DM assistant at present. Since this forum is publicly visible,  if you have difficulty sharing the info, you may create a private support ticket in your IDE's menu Help | Contact Support...

0

请先登录再写评论。