我无法使用Eclipse在托管模式(Debug as - > web application)中启动我的GWT应用程序.它抛出了标题中提到的异常.Eclipse调试向我展示了以下代码:
/*
* GOOGLE: Since we're bundling our own version of SWT, we need to be
* able to tell SWT where its dynamic libraries live. Otherwise we'd
* have to force our users to always specify a -Djava.library.path
* on the command line.
*/
String swtLibraryPath = System.getProperty ("swt.library.path");
try {
String newName = name + "-" + platform + "-" + version; //$NON-NLS-1$ //$NON-NLS-2$
if (swtLibraryPath != null)
System.load(swtLibraryPath + System.mapLibraryName(newName));
else
System.loadLibrary (newName);
return;
} catch (UnsatisfiedLinkError e1) {
try {
String newName = name + "-" + platform; //$NON-NLS-1$
if (swtLibraryPath != null)
System.load(swtLibraryPath + System.mapLibraryName(newName));
else
System.loadLibrary (newName);
return;
} catch (UnsatisfiedLinkError e2) {
throw e1;
}
}
Run Code Online (Sandbox Code Playgroud)
抛出的异常是e1.我没有对应用程序进行任何更改,只是创建它并启动了调试.
我错过了什么?我正在使用Ubuntu 9.04 64位(不知道这是否重要)
编辑:堆栈跟踪
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/rafael/.eclipse/640022211/plugins/com.google.gwt.eclipse.sdkbundle.linux_1.7.0.v200907291526/gwt-linux-1.7.0/libswt-pi-gtk-3235.so: /home/rafael/.eclipse/640022211/plugins/com.google.gwt.eclipse.sdkbundle.linux_1.7.0.v200907291526/gwt-linux-1.7.0/libswt-pi-gtk-3235.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1767)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1663)
at java.lang.Runtime.load0(Runtime.java:787)
at java.lang.System.load(System.java:1022)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:132)
at org.eclipse.swt.internal.gtk.OS.(OS.java:22)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
at org.eclipse.swt.widgets.Display.(Display.java:126)
at com.google.gwt.dev.SwtHostedModeBase.(SwtHostedModeBase.java:82)
Could not find the main class: com.google.gwt.dev.HostedMode. Program will exit.
解决了这个问题.在仔细阅读了堆栈跟踪之后(感谢Warren!),我最终搜索了不同的术语,并确定原因确实是单词宽度问题.
解决方案是安装32位JVM并告诉Eclipse使用它而不是64位JVM.这是通过安装新的JVM,在Eclipse中转到Window> Preferences> Java> Installed JRE并添加新的JVM(记得指向jre dir)来完成的.然后我将其设置为默认值,并设法运行该示例.
| 归档时间: |
|
| 查看次数: |
2750 次 |
| 最近记录: |