在Mac上使用SWT的问题 [英] Problems With SWT on Mac

查看:161
本文介绍了在Mac上使用SWT的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用SWT UI的java项目,我在任何Mac OS X计算机上部署都遇到了问题。当程序从Eclipse中运行或从jar文件运行时,程序本身在Windows上运行良好。在Mac上,该程序在Eclipse中运行良好,但是当我尝试从jar文件运行它时,我收到以下错误:

I've got a java project that uses an SWT UI and I'm having trouble deploying it on any Mac OS X computers. The program itself works perfectly on Windows when it is either run from within Eclipse or from a jar file. On Mac, the program also works fine in Eclipse, but when I try to run it from a jar file, I get the following error:

2010-04-30 13:33:04.564 java[17825:41b] *** _NSAutoreleaseNoPool(): Object 0x10b9b0 of class NSCFString autoreleased with no pool in place - just leaking
Stack: (0x944acf4f 0x943b9432 0x678fb79 0x35a19b1 0x359ba7f)
2010-04-30 13:33:04.566 java[17825:41b] *** _NSAutoreleaseNoPool(): Object 0x115ef0 of class NSCFNumber autoreleased with no pool in place - just leaking
Stack: (0x944acf4f 0x943b9432 0x678a0b0 0x35a19b1 0x359ba7f)
2010-04-30 13:33:04.567 java[17825:41b] *** _NSAutoreleaseNoPool(): Object 0x121000 of class NSCFString autoreleased with no pool in place - just leaking
Stack: (0x944acf4f 0x943b9432 0x678fb79 0x35a19b1)
2010-04-30 13:33:04.581 java[17825:41b] *** _NSAutoreleaseNoPool(): Object 0x123720 of class NSPathStore2 autoreleased with no pool in place - just leaking
Stack: (0x944acf4f 0x943ba637 0x943c238f 0x943c1e8e 0x943c694b 0x678992e 0x35a19b1)
2010-04-30 13:33:04.582 java[17825:41b] *** _NSAutoreleaseNoPool(): Object 0x12d660 of class NSPathStore2 autoreleased with no pool in place - just leaking
Stack: (0x944acf4f 0x943ba637 0x943b9739 0x943c3eb2 0x943c6b22 0x678992e 0x35a19b1)
...
...
...

实际错误要大得多,并一直持续到程序崩溃。

The actual error is much larger, and continues until the program crashes.

我知道我正在使用正确的swt.jar文件,我尝试使用-XstartOnFirstThread VM参数运行程序,但仍然没有运气。

I know that I am using the correct swt.jar file and I have tried running the program with the -XstartOnFirstThread VM argument, but still have not had any luck.

有没有人有任何想法或建议我可以开始寻找解决方案?

Does anybody have any ideas or any suggestions where I could start looking for a solution?

谢谢。

推荐答案

是捆绑了应用程序还是从命令行运行它?如果是捆绑的,则需要在Info.plist文件的Java字典中输入值 StartOnMainThread ,其值为 true 。如果未捆绑,则参数为 java -XstartOnFirstThread 。是的,他们是不同的,是的,不幸的是,这很烦人。

Is the application bundled or are you running it from the command line? If bundled, you need to put the key StartOnMainThread with value true in the Java dictionary of the Info.plist file. If not bundled, the argument is java -XstartOnFirstThread. Yes, they are different, and yes, that's unfortunately annoying.

这篇关于在Mac上使用SWT的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆