There are a couple of extra steps that are specifically required in order to work with SWT. The first is setting up the main SWT project for the specific operating system, and the second is obtaining the pre-compiled native libraries that are required in order to communicate with the operating system.
Firstly, the project's platform-specific
.classpath
needs to be copied (or symlinked) so that the project compiles. Since SWT has a number of platform-specific elements, they need to be referred to in the classpath. In the root of theorg.eclipse.swt
project, there are three files:.classpath_cocoa
(for macOS),.classpath_gtk
(for Linux), and.classpath_win32
(for Windows). Copy or symlink the appropriate one to.classpath
in order to compile the project.