How do you build an SWT application with Maven

后端 未结 6 1667
忘掉有多难
忘掉有多难 2020-12-29 22:57

I trying to learn swt, and I use maven for all my builds and eclipse for my IDE. When getting the swt jars out of the maven repository, I get:

Exception in t         


        
6条回答
  •  臣服心动
    2020-12-29 23:24

    Sounds like Maven is pulling in an old version of SWT. As of v3.4 (and higher), the swt.jar is all you need. SWT will automatically extract the .sos, .jnilibs or .dlls as necessary. The only tricky thing you need to worry about is to ensure that you get the right swt.jar (meaning for your platform).

    Try installing SWT 3.4 in your local repository by hand. If that still gives you the same problem, then something is probably fishy. After that, I would try extracting the .sos manually and then specifying the java.library.path variable using the -D switch on invocation. Sometimes on Linux the loading of the libraries can fail due to dependency problems (in things like libpango). In such cases, often the error will be just the generic UnsatisifedLinkError, making the problem difficult to debug.

提交回复
热议问题