Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you change the Dock Icon of a Java program?

How can I change the Dock Icon of a program, in Java, on the Macintosh platform? I have heard about using Apple's Java library (that provides some sort of extra support on the Mac platform), but I have yet to find some actual examples.

like image 941
Martin Tuskevicius Avatar asked May 15 '11 02:05

Martin Tuskevicius


People also ask

How do I change my Java icon Mac?

In Eclipse, go to File>Export and choose the 'Mac OS X Application Bundle' option inside the 'Other' directory. Click the next button. Then you'll be presented with the 'Application Bundle Export Menu'. The last option on this menu is 'Icon'.


1 Answers

While I'm not sure how to change it at runtime, you can set at the command line your Dock icon using the -Xdock:icon option, like:

 >java -Xdock:icon=/path/myIcon.png myApp 

This article has lots of useful little info about bringing java apps to Mac, and you may be interested looking at the utilities and tools for Mac listed here, as well as deployment options listed here (the last link is especially useful if you want to go down the Java Webstart route).

like image 107
Zach L Avatar answered Oct 06 '22 19:10

Zach L