zoukankan      html  css  js  c++  java
  • 使用eclipse新建一个SWT工程

    照着eclipse的引导教程,新建一个swt的hello world程序。

    我是一步一步跟着做的,但是编译通过却运行报错。

    在网上找到了相似的情况,解决了,于是贴在这里。

    问题:

    n a WinDoze 7 Pro 32-bit machine, if I follow the instructions for creating a Hello World SWT example, it will work for Helios, but when I try it on Indigo, it fails with the following message:

    Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    	no swt-win32-3735 in java.library.path
    	no swt-win32 in java.library.path
    	Can't load library: C:\Users\arick\.swt\lib\win32\x86\swt-win32-3735.dll
    	Can't load library: C:\Users\arick\.swt\lib\win32\x86\swt-win32.dll
    
    	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:285)
    	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:194)
    	at org.eclipse.swt.internal.C.<clinit>(C.java:21)
    	at org.eclipse.swt.widgets.Display.<clinit>(Display.java:138)
    	at HelloWorldSWT.main(HelloWorldSWT.java:12)



    The project, org.eclipse.swt.win32.win32.x86 is in the build path of my HelloWorldSWT project. What I don't understand is why it is looking in my home directory for the SWT DLL?

    解答:

    Had Same initial issue and finally sorted it by...

    Right click on project and go to Properties

    In Java Build Path under the Projects tab there is the associated Project, in my case org.eclipse.swt.win32.win32.x86

    Expand this down with the little arrow to the left to display the options. Here I found Native Library Locations. This wasn't set so I selected it and clicked Edit.

    In the Popup window that follows, I selected Workspace and then org.eclipse.swt.win32.win32.x86.

    Next time I ran the class, it work fine.

    I hope this helps someone!

  • 相关阅读:
    read()系统调用的流程(转个贴)
    linux kernel reading
    开博第一篇
    让人崩溃的Visual C++ 2005 SP1 Redistributable Package (x86),为啥我下不下来?
    System Call on Linux 2.6 for i386(2) int 0x80与systementer
    http://www.netyi.net/in.asp?id=yuanxianping
    取Insert产生的ID
    递归触发器资料
    Commit Trans和Rollback Trans在有触发器操作时的区别
    转:安全配置SQL Server2000服务器
  • 原文地址:https://www.cnblogs.com/CAION/p/2811878.html
Copyright © 2011-2022 走看看