Eclipse launcher

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.

Fixes:

  1. Eclipse.app shall not be an LSUIElement 1 application, so that it will appear in the dock when running.
  2. The application that shows the startupscreen shall be an LSUIElement 1 application. Packaged inside Eclipse.app
  3. 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:

  1. 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.
  2. Launch with a command like this:
    exec(“/usr/bin/java”,”…Eclipse.app/Contents/MacOS/eclipse”,argv[1]..);
    This causes java to be started but when CFBundleGetMainBundle called it will return the Eclipse bundle.
  3. Write a custom java launcher app.

Runtime behaviour with (2):

  1. User clicks tha Eclipse.app
  2. OSX starts executing Eclipse.app and bounches the icon
  3. Eclipse app forks, and starts EclipseLaucnher. The Eclipse.app quits bouncing stops.
  4. 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.

Advertisements

Comments are closed.

%d bloggers like this: