user46418
user46418

Reputation: 19

How to set ICON image for java.jar executable jar file

I have developed a game in Java made an executable jar file mygame.jar.

I now want to set an ICON image to mygame.jar so that it shows my custom image instead of usual java tea cup image.

Please don't confuse this with setting frame icon image with frame.setImageIcon("") method to set frame ICON image. I want my custom image to show up in mygame.jar desktop ICON

Upvotes: 1

Views: 5518

Answers (3)

Mustafa sabir
Mustafa sabir

Reputation: 4360

You can use a wrapper like JSmooth for jars. Not only does it allow you to define custom icons for your java applications, it also creates .exe for your java applications.

JSmooth DOC and a good tutorial

Upvotes: 1

sparklyllama
sparklyllama

Reputation: 1326

Unfortunately, the icon of a .jar file cannot be changed. The only way to set the icon is to convert it to a different form of executable. Such as .exe for windows, and .app for mac.

You can use tools such as JarBundler or Appbundler for converting to app, and there are a few tools for converting to .exe.

Upvotes: 2

Héctor
Héctor

Reputation: 26054

Is not possible. Not in the jar itself. You have to generate a wrapper that executes the jar, and this script will have the icon. You can try JSmooth.

Upvotes: 0

Related Questions