Growl support for Eclipse RCP
July 5th, 2009On Mac OS X, Growl has become the de facto standard for all notifications. There is an opened bug asking for Growl support in SWT/RCP : Bug 209911 – [Mac] Support for Growl notifications.
The best solution would be to have a standard API for notification with support for notification plug ins (including growl) and this is exactly what is discussed on bug 209911 and on the wiki page for Platform UI/Notifications.
But for those wanting to add Growl support to their applications as soon as possible, I’ve just attached to bug 209911 a plug-in which can successfully send Growl notifications.
The Growl wrapper depends on Apple’s Java/cocoa bindings, so the trick was to add external libraries to the plugin classpath :
Bundle-ClassPath: .,
external:/System/Library/Java
It works, but you should know that :
- Apple Java/Cocoa bindings are deprecated.
- This does not work with Cocoa/x86_64, probably because of the deprecation. There you get the following error :
java.lang.UnsatisfiedLinkError: /usr/lib/java/libObjCJava.A.dylib: no suitable
image found. Did find: /usr/lib/java/libObjCJava.A.dylib: no matching
architecture in universal wrapper
Hopefully, the Growl wrapper is a really small class, and it should be rather easy to rewrite it with SWT’s internal Cocoa packages for someone who knows Cocoa (I don’t). If you want to take a look at the wrapper, just download my attachment to Bug 209911 and take a look at the class : com.growl.Growl.






