The swt faq (9)

Source: Internet
Author: User
Tags gtk

Http://www.eclipse.org/swt/faq.php)

Translation: Frank (AT) zijinshi.cn)

Version: Version 0.9

The SWT FAQ

17. Q: Why is this error message: "Java. Lang. noclassdeffounderror: ORG/Eclipse/SWT/Internal/XXX/OS ."?
A: On some platforms, such as GTK, SWT is divided into several jar files. Therefore, make sure that all required jar files are listed in classpath. The required jar files are:

  • SWT. Jar (all platforms)
  • Swt-pi.jar (some platforms like GTK and carbon)
  • Swt-mozilla.jar (Browser components for GTK and motif)
  • Swt-gtk.jar (for Linux motif)
18. Q: Why is this error message: "Java. Lang. unsatisfiedlinkerror: No swt-win32-3232 in Java. Library. path ."?
A: You need to place the swt jni Library (which allows Java to use local components) where a Java VM can find it.

Swt jni libraries is included in the SWT download file.

You can use the following methods to let Java applications know the library path.

  1. Set the library path in the VM's home load parameters.

    In launch configuration dialog, select the arguments page and enter-Djava. Library. Path = {runtime-library-path}Here, runtime-library-path is the path that contains the directory of the local code library.

    This scheme means that the SWT library has to be manually added to each project using SWT.

  2. Set the library path in environment variables.

    For Windows systems, add the runtime-library-path mentioned above in the PATH environment variable.
    In win 9x, You need to modify the autoexec. BAT file.
    In NT or 2 k machines, you canMy computer>Properties>Advanced>Environment VariablesEdit the variable.

    In Linux/Unix systems, modify the LD_LIBRARY_PATH variable to include the runtime-library-path.

  3. Copy the SWT library to a directory that is already a Java library path. For example, the JRE/bin directory.

    The disadvantage of this solution is that every time you upgrade eclipse, you have to remember to copy the local code library.

Since eclipse 3.1, the SWT plug-in has added the JNI library to SWT. jar. It supports osgi and eclipse RCP. If you use this plug-in, you must include the library in the path.

(To be continued ...)

 

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.