The eclipse laucnher on MacOSX has the following problem:
If you store it in dock it creates a second icon.
Current architecure of the Eclipse launcher:
- Eclipse.app: an LSUIElement=1 application, => won’t have a Dock icon. It just shows a startup screen while launching the eclipse.
- java: will have an eclipse icon, but the location is /usr/bin/java, so will be a diffrent item in the dock.
- Eclipse.app shall not be an LSUIElement 1 application, so that it will appear in the dock when running.
- The application that shows the startupscreen shall be an LSUIElement 1 application. Packaged inside Eclipse.app
- OSX shall be fooled when launching /usr/bin/java to think that is has launched from the Eclipse.app location.
Fooling the system about the location of the laucnhed(/usr/bin/java) application:
We have 3 solutions:
- Before laucnhing set CFProcessPath, to the bundle executable. It works, but someone has to kill the CFProcessPath variable after eclipse started otherwise all programs started from eclipse will be behaving like it has the Eclipse.app location. Unfortunatedly this doesn’t seems to work. Event tough the CFGetMainBundle will return the correct thing. (Eclipse package instead of Java) It won’t have the correct location displayed in the dock for Show Original. It’ll also create a different icon if the Eclipse.app icon is in the dock.
- Launch with a command like this:
This causes java to be started but when CFBundleGetMainBundle called it will return the Eclipse bundle.
- Write a custom java launcher app.
Runtime behaviour with (2):
- User clicks tha Eclipse.app
- OSX starts executing Eclipse.app and bounches the icon
- Eclipse app forks, and starts EclipseLaucnher. The Eclipse.app quits bouncing stops.
- EclipseLaucnher starts /usr/bin/java, and fakes Eclipse.app as the process location, this causes the icon to appear.
See Eclipse Bug 53260, cannot keep eclipse app in the Dock.