OS X: set application icon when launching Java/Swing application from shellscript

Until now I used JavaApplicationStub inside a .app directory structure to launch our Java/Swing application on OS X. The dock icon configured in the Info.plist works fine.

Now I've tried to launch the application using a shell-script inside the .app directory structure, but the dock icon only shows the one configured in Info.plist for a very short time and then falls back to the Java default icon. What I need to do that the configured icon remains there?


OK, I've found the solution. I had to add the -Xdock:icon=<path> command line option.

Did you try using Window.getIconImages ?

Need Your Help

Method error handling for user friendly messages

php exception-handling

I have an object oriented app (written in an MVC framework) and often my error handling procedures are ad-hoc. Sometimes I return 0 for no error, sometimes a true for success. In general there is n...

C++ to C# conversion of SendMessage using COPYDATASTRUCT

c# c++ pointers marshalling sendmessage

I'm converting a C++ application into C# which has generally been fairly straight forward, but now I'm dealing with pointers and running into problems.