The SWT project currently maintains one distributable for each supported operating system. For example:
swt-3.4.2-win32-win32-x86.zip
swt-3.4.2-gtk-linux-x86.zip
swt-3.4.2-carbon-macosx.zip
Is there a distributable that just Does the Right Thing™, regardless of which operating system the application is running on?
No, there isn't, and you can't make one either out of the standalone SWT distributions. That's because each os/windowing system/architecture combination has its own implementation of each of the SWT classes. For example, if your code refers to org.eclipse.swt.widgets.Button, the JVM has no way of knowing if you want the win32, Mac/Carbon or Mac/Cocoa implementation of the class.
You could conceivably do this yourself by writing a loader class that figured out the platform, architecture and windowing system and then loaded the right JAR. Or, architect your application using equinox, and it can load the right SWT plugin for you automatically. But you can't do it with any of the unmodified SWT distributions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With