Don’t rename Eclipse.app

Don’t rename Eclipse.app! At least, don’t do it on MacOS X. I did it, because I have several Eclipse versions installed and I wanted to distinguish them in the Dock. This caused Eclipse to crash on startup. But not immediately. It took some time untill the error emerged and this made it difficult for me to relate the startup failure to the renaming of the app.

What I did was the following: I downloaded a fresh Gallileo, extracted it to my Application Folder, renamed Eclipse.app to Eclipse-3.5-php.app and started Eclipse. Everything worked fine including several restarts. But things went bad, after I installed Subversive. Eclipse did not start anymore. The startup process failed very early, in fact it failed before it begins :). Not even the splashscreen was shown.

java.lang.ClassNotFoundException:org.eclipse.core.runtime.adaptor.EclipseStarter

I was swift to blame Subversive for not beeing Galileo-ready, but after some investigations it turned out that  the update process when installing new features writes a file called config.ini. This contains amongst others the following entry

osgi.framework=file\:/Applications/eclipse-3.5-php/Eclipse.app/Contents/MacOS/plugins/org.eclipse.osgi_3.5.0.v20090520.jar

which points to a non existing path, since I renamed Eclipse.app to  Eclipse-3.5-php.app (for those who wonder why the path goes right through the app file and continues inside: Mac OS X apps are directories that are displayed as files in the finder. You double click them to launch the application) .

I replaced the Eclipse directory with a fresh copy, did not rename Eclipse.app this time and after installing Subversive again the line in the new config.ini reads like this

osgi.framework=file\:plugins/org.eclipse.osgi_3.5.0.v20090520.jar

I was tempted to argue that the update manager is doing a poor job, when determing the path to its resources. But there may be situations in which it is the last exit to rely on default pathes. And the fact, that the update manager uses sometimes an absolute and sometimes a relative path indicates that there must be some situation where the configuration can exist outside of the app directory.

So why making things more complicated than they are? I finally realized that there is no need to rename the Application. Just use an alias instead and place this in the dock.

Works now well for me.

Tags: , ,

geschrieben am 14.06.2009 um 07:06 in Netzgedanken von cf · RSS 2.0 feed.
Zur Zeit können keine Kommentare abgegeben werden. Setze doch einen Trackback auf deine Seite.