SWT GTK 64 位和 UBUNTU 11.04 NPE
我目前正在开发 SWT 独立应用程序。我们通常使用 Windows,但我想在 Ubuntu 中工作。我设置了以下环境。
Ubuntu 11.04 64 位 Java 6 更新 27 64 位 Eclipse Java EE 3.5 Galileo 64 位 我正在使用 SWT GTK 64 位,
我有一些扩展不同 SWT 小部件的类。
例如,
public class MyCombo extends Combo implements CellEditor<Long> {
private Set<ListenerRef> listeners = new HashSet<ListenerRef>();
@Override
public void addListener(int eventType, Listener listener) {
listeners.add(new MyCombo.ListenerRef(eventType, listener));
super.addListener(eventType, listener);
}
@Override
protected void checkSubclass() {
// Do nothing
}
.
.
.
此代码在 Windows 7 64 位中运行良好,运行 SWT32 位和 java32 位,来自 eclipse 32 位。
在 Ubuntu 11.04 中,当尝试添加侦听器时,我收到 NPE (NullPointerException),似乎侦听器集为空,但它不应该导致该集应按照上面的代码进行初始化,正如我所说,它适用于Windows 7
首先,我在 Ubuntu64 位中运行 SWT 32 位应用程序时遇到问题,因为在 64 位 ubuntu 中运行 32 位应用程序时似乎存在错误,因此我尝试使用64 版本,现在我收到此错误。如果我避免这个 NPE 检查集合,我最终会得到一个
java.lang.NullPointerException
at org.eclipse.swt.accessibility.Accessible.isValidThread(Unknown Source)
at org.eclipse.swt.accessibility.Accessible.checkWidget(Unknown Source)
at org.eclipse.swt.accessibility.Accessible.addRelation(Unknown Source)
任何想法可能是什么原因?您在以前的 Ubuntu 发行版中注意到这个问题吗?我在 Windows 7 中没有遇到这个问题,至少运行 SWT 32 位
如果您需要更多详细信息请告诉我
谢谢并问候
顺便说一句我忘记了,SWT 在 Linux 中是 3.7,在 Windows 中是 3.6.2
I'm currently working in an SWT standalone application. We usually work with windows but I'd like to work in Ubuntu.I set up the following environment.
Ubuntu 11.04 64bit
Java 6 update 27 64 bit
Eclipse Java EE 3.5 Galileo 64 bit
I'm using SWT GTK 64 bit
I've got a few classes extending different SWT widgets.
For example
public class MyCombo extends Combo implements CellEditor<Long> {
private Set<ListenerRef> listeners = new HashSet<ListenerRef>();
@Override
public void addListener(int eventType, Listener listener) {
listeners.add(new MyCombo.ListenerRef(eventType, listener));
super.addListener(eventType, listener);
}
@Override
protected void checkSubclass() {
// Do nothing
}
.
.
.
This code works perfectly well in Windows 7 64 bit, running SWT32 bit and java32 bit, from eclipse 32 bit.
In Ubuntu 11.04 I get a NPE (NullPointerException) when trying to add a listener, it seems that the listeners set is null, but it shouldn't cause that set should be initialized as for the code above, and as I say it works in Windows 7
First I had problems running the SWT 32 bit app in Ubuntu64 bit cause there's seem to be a bug when running 32 apps in 64 ubuntu, so I tried to run it with the 64 version, and now I'm getting this error. If I avoid this NPE checking the set, I end up getting a
java.lang.NullPointerException
at org.eclipse.swt.accessibility.Accessible.isValidThread(Unknown Source)
at org.eclipse.swt.accessibility.Accessible.checkWidget(Unknown Source)
at org.eclipse.swt.accessibility.Accessible.addRelation(Unknown Source)
Any ideas of what could be the reason? Are you aware of this problem in previous Ubuntu distrubutions? I don't get this problems in Windows 7, at least running SWT 32 bit
Please let me know if you need more details
Thanks and regards
BTW I forgot, SWT is 3.7 in Linux and 3.6.2 in Windows
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论