Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

display icon for core java executable jar

 
a kishore
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

Can any one help me to find solution to display icon for an executable jar which i am going to distribute.
Here the issue is i am not using either swings or applets.
So, is it possible with core java executable jar ?

Appreciations in advance.



kishore
 
Stephan van Hulst
Bartender
Pie
Posts: 5790
61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think so. The icon associated with your jar will be associated with all jars, and I doubt that's what you want.

If you want a custom icon, I think you will have to use a wrapper executable with your icon, which simply starts up your jar.
 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or a simple shortcut (.lnk) file with its own icon set.
 
a kishore
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephan and Rob many thanks for your replies.

Stephan, can you give steps how to make wrapper executable jar with icon. I mean where to place icon and how to call it, either in manifest file or how. I'm bit new to this.

Rob, I don't think I can use that if I want to distribute this jar together with that icon. If there is any possibility please let me know.



Thanks
kishore
 
Stephan van Hulst
Bartender
Pie
Posts: 5790
61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, a wrapper executable is simply a small program in a native language, that has the icon built in, and has the only task of starting up the JVM with your program.

Rob's solution is more elegant. I don't know about other operating systems, but in Windows, you can create a new shortcut through the context menu (right mouse button) and have it link to your Jar. Then, right click the shortcut and go to properties, and you can embed an icon into it.

You will have to provide different shortcuts for different OSes.
 
a kishore
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Stephan. I managed to do it now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic