What to do when you get an UnsatisifiedLinkError when running an SWT or JFace application
So you're trying to run an SWT application (or JFace, since JFace relies on SWT) inside Eclipse and you get the dreaded UnsatisfiedLinkError. This usually appears as one of the following: Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-pi-carbon-3063 in java.library.path (Carbon on Mac OS X), Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-win32-3063 in java.library.path (Win32 on Windows), or Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-pi-gtk-3063 in java.library.path (GTK2 on Linux). Those are the UnsatisifiedLinkErrors for SWT in Eclipse 3.0.1.
For Eclipse 3.0, it would be swt-pi-carbon-3062, swt-win32-3062, and swt-pi-gtk3062 respectively.
Now there is an easy correction for this. Just go to "Run" | "Run...", which brings up the "Run" dialog. Then navigate to the "Arguments" tab and in the "VM Arguments:" text box, enter (for Eclipse 3.0.1):
-Djava.library.path=${system:ECLIPSE_HOME}/plugins/org.eclipse.swt.carbon_3.0.1/os/macosx/ppc (for Carbon on Mac OS X)
-Djava.library.path=${system:ECLIPSE_HOME}/plugins/org.eclipse.swt.win32_3.0.1/os/win32/x86 (for Win32 on Windows) or
-Djava.library.path=${system:ECLIPSE_HOME}/plugins/org.eclipse.swt.gtk_3.0.1/os/linux/x86 (for GTK2 on Linux).
For Eclipse 3.0, substitute 3.0.0 wherever you see 3.0.1.