Tutorial :Does SWT distribute a JAR that works on any supported operating system?



Question:

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?


Solution:1

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.


Solution:2

To my knowledge, no: those eclipse products are always distributed per platform


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »