Eclipse

Using SWT from CVS

SWT lives in Eclipse CVS at dev.eclipse.org.

Running with SWT from CVS takes a bit of work to set up for your platform. Here is a quick guide to help you get set up.

  1. First, set up the CVSROOT. Use File > Import... > Checkout Projects from CVS and add enter the information for the Eclipse CVS server.

    cvsroot

  2. Next, check out the org.eclipse.swt project, where all the Java code lives, along with the correct binary package for the DLLs from your platform.

    checkout

    Each platform has a module for the binaries categorized by toolkit, OS, and CPU architecture.

    Windows org.eclipse.swt.win32.win32.x86
    Mac OS X org.eclipse.swt.carbon.macosx
    Linux GTK org.eclipse.swt.gtk.linux.x86
    Linux Motif org.eclipse.swt.motif.linux.x86

  3. SWT has a different Eclipse .classpath file for each platform, so we need to set up Eclipse to use the right one. To do this we first switch over to the Resource perspective.

    perspective

  4. Next, we expand org.eclipse.swt and find the .classpath_xxx file for our platform and copy it to a file named .classpath.

    classpath

  5. After changing a .classpath file, it's usually a good idea to clean the projects that depend on it to make sure everyone is cool.
    (Note that if you are building for a 64-bit platform, there is an extra step needed. Please see this FAQ for details).

    classpath

  6. We're ready to go! To test our checkout, let's find an SWT application to run. How about the ControlExample.

    controlexample

  7. After we've selected the ControlExample.java file, we can run it using Run > Run As > Java Application from the menu.

    runas

And there you go!