This article assumes that readers use Windows operating system +jdk1.4, and other platforms and JDK versions should also be sorta.
To compile and run the SWT program, we have two choices: 1-Download separate SWT binaries and source files using Eclipse sdk;2-.
With the Eclipse SDK, we can find SWT binaries in its plugins directory, the usual directory name is: org.eclipse.swt.win32_xxxx, suffix is version number, there are OS and WS two subdirectories under this directory, The content is SWT's JNI library and Swt.jar.
If you are not using eclipse to develop, or need SWT source files, you need to download a separate SWT binary and source package, located at the following address:
This zip file, which contains the JNI library (some DLLs) and Swt.jar, as well as Swtsrc.zip, is the source of our SWT, including the C and Java source code.
In order to run the SWT program, we need to first compile our SWT code, This time you need to tell the compiler where the Swt.jar, after the success of the compilation, in addition to the classpath contains Swt.jar, we need to tell java.exe another parameter at the command line, that is Java.library.path, looks like this:
If you are using the Eclipse SDK 3.1m5a or newer version, you can directly right-click. java file Select RunAs-> SWT application, you don't have to write that long argument at the command line.
Interestingly, we can see the current SWT-supported platforms on Eclipse.org's SWT download page:
Windows 98/me/2000/xp Windows CE (ARM PocketPC) Windows CE (ARM PocketPC, J2ME profile) Linux (x86/motif Linux (x86/gtk 2) Linux (AMD 64/gtk 2) Solaris 8 (sparc/motif) QNX (X86/photon) AIX (ppc/ MOTIF) HP-UX (HP9000/MOTIF) Mac OS X (Mac/carbon)
Oh, the support of the platform, although limited, but still quite a lot.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.