Archive for the ‘Mac OS X’ Category

Running eclipse with GTK on Mac OSX

Monday, August 22nd, 2005

So, the eclipse performance on OSX was bugging me enough that I decided to try getting the eclipse GTK port running on OSX. The idea being that eclipse GTK runs pretty good on linux these days, so it should run similary well on OSX.

So, the eclipse performance on OSX was bugging me enough that I decided to try getting the eclipse GTK port running on OSX. The idea being that eclipse GTK runs pretty good on linux these days, so it should run similary well on OSX.

Well, I was partially right. While it does run a lot faster than carbonized eclipse, there are a bunch of UI glitches that make it less usable for me. I’m hoping that if I document how I got it to work, maybe someone else can do the grunt work of trying out other alternatives that may fix the problems I am having. If you do, I’d appreciate the feedback.

First some pre-requisites. You’ll need to have a X server installed and the gtk libraries. I’m using the Apple X server (from OSX 10.4 install CD), and used fink to install all the gtk libraries I needed - in fink-commander, install everything with gtk+ in the name.

Next, get the eclipse linux-gtk 3.1 release and extract it to the directory of your choice (I used /Applications/eclipse-swt. This makes for an easy starting point since I didn’t feel like creating a new eclipse port and building from scratch.

There are really only 3 native components we need to worry about replacing, two of which are optional. The launcher we can bypass by using java to launch eclipse, and the org.eclipse.core.resources.linux only improves filesystem performance, defaulting to java.io.File if the native library is not present. The only one we really need to do anything for is the swt plugin. Fortunately, one of the eclipse developers recently ported/compiled the swt-gtk libraries for OSX, and you can fetch them from here.

Now you need to extract the swt plugin into a directory of the same name:

cd <eclipseInstall>/plugins; unzip -d org.eclipse.swt.gtk.linux.x86_3.1.0 org.eclipse.swt.gtk.linux.x86_3.1.0.jar

Remove the jar when you are done. Next you need to copy the osx-swt-gtk *.jnilib files from the above download into the directory you just created. I also deleted the existing binaries from that directory to be safe.

Finally, to run eclipse, you have to use the command line to run the java launcher directly. Make sure your X server is running, and the shell you are running from has the DISPLAY=:0 environment set. Then the command to run eclipse is

java -cp <eclipseInstall>/startup.jar org.eclipse.core.launcher.Main -clean -os linux -ws gtk -arch x86 -vmargs -Xmx512M

Note that I specified linux/gtk/x86, which seems counter intuitive, but thats the download we started from. Also, you probably don’t want to use an existing workspace, so pick an empty directory for your workspace location.

Now, assuming I didn’t miss anything (let me know if I did), your eclipse should fire right up using swt-gtk.

Issues I have

  • Dialogs are all weird sizes/layouts, no idea how to fix them. Especially broken is the Find dialog (ctrl-f in an editor)
  • Related to dialogs, but more annoying to my work habits, the ctrl-f6 used for switching between editors is unreadable because its too small.

Things to do

  • Billy Biggs (eclipse guy who made the binaries) mentioned on eclipse.platform.swt newsgroup that fonts may be to blame, could be worth investigating.
  • Try a different X-server, maybe a more recent build of Xfree/Xorg from fink or darwinports would fix some of the dialog issues
  • Try some different window managers - I only tried the built in apple one and gnome-metacity, both exhibited same funky dialogs
  • If other issues are resolved acceptably, might be worthwhile to do the full macosx/gtk/ppc port using the eclipse source distribution. At the very least, the core.resources binary from linux/gtk/x86 should be recompiled in the same way swt libs were so that we don’t suffer when doing a workspace refresh.

Eclipse performance under OSX

Friday, August 19th, 2005

Dog slow!

A couple of things I’ve learned

  • Stop spotlight from indexing eclipse workspace.
  • Bug in Tiger/Java that causes eclipse to slow to a crawl after launching a (java?) app. This was really killing me because I have a builder than runs an ant script, so my performance was always in the shitter. Better now that I’ve removed the builder, but the UI still seems very slow - especially when using Apple-F6 to switch between editors. I hear that disabling a bunch of things like CVS decorators make it better, but haven’t tried it yet cuz I like those things. See this eclipse bug for details on the Java performance problem under OSX (boy I sure wish I could find a torrent for 10.4.3 build 8F8)
  • I’ve been experimenting with getting eclipse to run with GTK bindings under OSX. I;ve bgotten it working, but it has too many issues to make it suitable for me. I’ll publish the details in another entry if anyone comments that they are interested. Maybe someone else can take up the torch and get it working well.

Made the switch

Friday, August 19th, 2005

Well, hell has finally frozen over as I've made the switch (at least for work) to Apple. Specifically, 17" Powerbook G4 running OSX 10.4 (Tiger).

I like what I see so far, now its just a matter of learning everything all over again.

My biggest gripe to date is not so much with Apple, but with the fact that eclipse is so much slower under OSX than Windows or Linux. Its kinda ironic that I make the switch from linux to OSX for development work right when eclipse is finally performing acceptably on GTK - exactly the same scenario when I made the switch from Windows to Linux. Lets hope that the performance improvements for OSX don't take as long as they did for GTK!