1

How is running a jar file from terminal different from running it directly??

What I want to ask is, I made a GUI application and added a launcher icon to it. When I run it from terminal, it shows the launcher icon and I can as obvious lock that icon to the launcher. But, when I run it directly, it shows the default jvm icon instead of the launcher icon I added. And, if I lock that icon to the launcher, and try to run the app by clicking the icon, it just doesn't do anything??

Is their any way, that it shows the same launcher icon I added to it??

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Shubham Jain
  • 392
  • 1
  • 3
  • 15

1 Answers1

-1

You need to set the dock icon in OSX for this to work.

Possible duplicate of the question : How do you change the Dock Icon of a Java program?

Additionally, refer this documentation : https://developer.apple.com/library/mac/documentation/Java/Conceptual/Java14Development/00-Intro/JavaDevelopment.html

Community
  • 1
  • 1
maheeka
  • 1,983
  • 1
  • 17
  • 25
  • is the question related to OSX or Mac somehow? Didn't see anything about that. – eis Oct 09 '14 at 12:48
  • Sorry misunderstood as OSX.If Linux, having the icon within the jar and accessing as a resource in the code should work. As for launching with double click, you can try creating a Desktop file (.desktop) for executing your jar. – maheeka Oct 09 '14 at 13:16
  • Thanks for the solution. Can you tell me why it was showing the jvm icon on double clicking. – Shubham Jain Oct 09 '14 at 14:25
  • That could be because the icon was not available in the jar and was not properly referred (as a resource) in the code. Hope this fixes your problem. – maheeka Oct 09 '14 at 17:04