简体   繁体   English

在 OSX 下使用 SWT

[英]Using SWT under OSX

I try to test a simple java application with SWT under Mac OS X. I can compile the source file without any problems but if I start the program then the following exception occurs:我尝试在 Mac OS X 下使用 SWT 测试一个简单的 java 应用程序。我可以毫无问题地编译源文件,但是如果我启动程序,则会发生以下异常:

java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM

The command to compile is: "javac -classpath .:swt.jar SWTHello.java" The command to run is: "java -d64 -XstartOnFirstThread -cp .:swt.jar SWTHello"编译命令为:“javac -classpath .:swt.jar SWTHello.java” 运行命令为:“java -d64 -XstartOnFirstThread -cp .:swt.jar SWTHello”

For the SWT library there's only one current osx version on the website so I guess I couldn't download a wrong jar.对于 SWT 库,网站上只有一个当前的 osx 版本,所以我想我无法下载错误的 jar。

Thanks in advance for your help!在此先感谢您的帮助!

Change the SWT jar in your project classpath, You are using a 32 bits cocoa, use the 64 bits:更改项目类路径中的 SWT jar,您使用的是 32 位可可,使用 64 位:

http://mvnrepository.com/artifact/org.eclipse.platform/org.eclipse.swt.cocoa.macosx.x86_64 http://mvnrepository.com/artifact/org.eclipse.platform/org.eclipse.swt.cocoa.macosx.x86_64

Had the same problem and it worked after replacing the swt .有同样的问题,更换 swt 后它工作了。

  1. Download swt http://mvnrepository.com/artifact/org.eclipse.platform/org.eclipse.swt.cocoa.macosx.x86_64下载 swt http://mvnrepository.com/artifact/org.eclipse.platform/org.eclipse.swt.cocoa.macosx.x86_64
  2. Replace it on this folder of your Pentaho-ce /data-integration/libswt/osx64将其替换到 Pentaho-ce /data-integration/libswt/osx64 的此文件夹中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM