0

我有一个使用 Eclipse 3.5 编写的现有 GWT 2.0 应用程序。但是当我升级到较新的 Eclipse 版本(3.6 到 3.8)时,我不再能够执行基于 Eclipse 的 GWT 编译,也不能在 Eclipse 中运行远程调试。具体来说,当我单击 GWT 编译按钮时,我在 .log 文件中收到以下错误条目:

java.lang.NoClassDefFoundError: org/eclipse/jdt/internal/debug/ui/SWTFactory
    at com.google.gwt.eclipse.core.compile.ui.GWTCompileDialog.createDialogArea(GWTCompileDialog.java:247)
    at org.eclipse.jface.dialogs.TitleAreaDialog.createContents(TitleAreaDialog.java:155)
    at com.google.gwt.eclipse.core.compile.ui.GWTCompileDialog.createContents(GWTCompileDialog.java:220)
    at org.eclipse.jface.window.Window.create(Window.java:431)
    at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
    at org.eclipse.jface.window.Window.open(Window.java:790)
    at com.google.gwt.eclipse.core.actions.GWTCompileToolbarAction.run(GWTCompileToolbarAction.java:82)
    at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

这是否意味着我每次升级到新的 Eclipse 版本时都需要升级 GWT 插件,或者有没有办法在新的 Eclipse 版本中仍然运行旧的 GWT 版本?感谢您的时间。

4

2 回答 2

1

您始终可以将 Eclipse 或 GPE 更新到最新版本,然后将其指向 GWT 2.0。

在 GPE 中设置 GWT 2.0

Right Click on A Project
Step 1 -> Goto Google -> "Web Toolkit Settings" 
Step 2 -> In the Right Panel Click "Configure" 
Step 3 -> Point to GWT 2.0 folder ( download it from GWT [here][1])
Step 4 -> Ensure you select the GWT 2.0 as the default by using checking box.
Step 5 -> Select Project -> Right Click -> "Build Path" -> Configure Build Path
Step 6 -> Ensure Java Build Path shows 2.0 in the library.

在此处输入图像描述 在此处输入图像描述 在此处输入图像描述

干净的编译和调试

Select Project - In eclipse top panel do "Project -> Clean"
Step 1 - Right Click on the Project
Step 2 - Goto "Debug" as "Web Application"
Step 3 - You can GPE Hosted console in eclipse.
Step 4 - Launch the application in Brower with hosted URL

GWT 编译

Select Project
Step 1 - Right Click on the Project
Step 2 - Goto "Google" -> "Gwt Compile"
Step 3 - Configure Entrypoint module in the GWT Compile dialog. Click oK.

在此处输入图像描述

于 2013-01-09T10:35:03.223 回答
0

如果你想安装 GWT 插件然后

  1. 单击帮助-> 安装新软件-> 然后将这个链接粘贴到那里 (http://dl.google.com/eclipse/plugin/2.0) 然后添加-> 确定
  2. 全选
  3. 点击下一步->完成

也尝试新插件。4.2 是最新的插件,也更新了 eclipse。

于 2013-01-09T10:22:42.737 回答