title: Create cross platform Java SWT Application
body: <p>I have written a Java GUI using SWT. I package the application using an ANT script (fragment below).</p>
  
  <pre><code>&lt;jar destfile="./build/jars/swtgui.jar" filesetmanifest="mergewithoutmain"&gt;
    &lt;manifest&gt;
      &lt;attribute name="Main-Class" value="org.swtgui.MainGui" /&gt;
      &lt;attribute name="Class-Path" value="." /&gt;
    &lt;/manifest&gt;
    &lt;fileset dir="./build/classes" includes="**/*.class" /&gt;
    &lt;zipfileset excludes="META-INF/*.SF" src="lib/org.eclipse.swt.win32.win32.x86_3.5.2.v3557f.jar" /&gt;
  &lt;/jar&gt;
  </code></pre>
  
  <p>This produces a single jar which on Windows I can just double click to run my GUI. The downside is that I have had to explicitly package the windows SWT package into my jar. </p>
  
  <p>I would like to be able to run my application on other platforms (primarily Linux and OS X). The simplest way to do it would be to create platform specific jars which packaged the appropriate SWT files into separate JARs.</p>
  
  <p>Is there a better way to do this? Is it possible to create a single JAR which would run on multiple platforms?</p>