0

i have an existing GWT 2.0 application that i wrote using Eclipse 3.5. but when i upgraded to newer Eclipse versions (3.6 through 3.8), i was no longer able to execute Eclipse-based GWT compilation, nor run remote debugging in Eclipse. specifically, when i click on the GWT compilation button, i get the following error entry in the .log file:

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)

does this mean that i need to upgrade GWT plugin every time i upgrade to newer Eclipse version, or is there a way to still run older GWT versions in newer Eclipse versions? thank you for your time.

Saeed Zarinfam
  • 8,782
  • 7
  • 55
  • 66
user1056027
  • 133
  • 2
  • 2
  • 12
  • Why would you need old plugin to work? Any particular reason not to use latest GPE with latest eclipse. – appbootup Jan 08 '13 at 07:07
  • Have you installed the version of the plugin to Eclipse 3.8 from the marketplace? Even if the libraries are in the classpath you still need to install the plugin to Eclipse. – Athanasios Kataras Jan 08 '13 at 07:52
  • @SSR: valid question, but i will not bore you with the details. that's just how it is. Thanos: i initially manually installed the plugin in eclipse 3.5 by placing it in the "dropins" dir. when i upgraded to newer eclipse releases, i did the very same thing. i was hoping to somehow stumble upon an official word from google on the matter, yet have not been able to locate it. – user1056027 Jan 08 '13 at 08:55
  • @Thanos, i am not sure i understand your question. are you asking me if i obtained the gwt plugin directly from its official location? if so, then the answer is yes. if course, since the gwt plugin v2.0 no longer exists on the official site, i am using the copy i obtained years back. – user1056027 Jan 08 '13 at 09:10
  • 1
    you need to install the plugin for Eclipse https://developers.google.com/web-toolkit/usingeclipse for the ide to compile the project correctly. But after that I think you can use any library you want be it 2.0 or 2.5 – Athanasios Kataras Jan 08 '13 at 09:21
  • the approach you describe installs the very latest gwt plugin, which is 2.5. once that is installed, i am not sure i understand how i can continue on using the code that is gwt 2.0-compliant. wouldn't my gwt-based eclipse project will be forced to make changes in order to be inline with 2.5? my goal is to stay away from that, and have eclipse 3.8 use the gwt 2.0 plugin rather than the latest one. – user1056027 Jan 08 '13 at 09:38
  • 1
    What you need is the older libraries. If you add the older libraries in the lib folder and specify them in the classpath removing the older ones I think you will be set. You can also define a GWT 2.0 libary package to automate this procedure in the future. – Athanasios Kataras Jan 08 '13 at 15:18
  • i installed the gwt plugin v2.5, yet kept the gwt-servlet.jar from gwt v2.0 in my project. but when then i ran the java compile in eclipse against my project, it resulted in the following error: "The file gwt-servlet.jar has a different size than GWT SDK library gwt-servlet.jar; perhaps it is a different version?". and when i replace my project's gwt-servlet.jar with the one from v2.5, the GWT compiler fails as expected since my code is nearly 3 years old. am i doing something wrong? – user1056027 Jan 09 '13 at 04:00
  • You should use the gwt-servlet.jar from gwt v2.0 only. – appbootup Jan 09 '13 at 10:01
  • Ensure your Build Path does not have GWT 2.5 libs in Java Build Path. Have posted step wise check in Anwser. – appbootup Jan 09 '13 at 10:54
  • @Thanos, thank you. looks like you were describing the same steps as SSR. i appreciate your help! – user1056027 Jan 10 '13 at 02:01

2 Answers2

1

You can always update Eclipse or GPE to latest and then point it to work with GWT 2.0.

Setting up GWT 2.0 in GPE

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.

enter image description here enter image description here enter image description here

Clean Compile and Debug

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 Compile

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.

enter image description here

appbootup
  • 9,486
  • 3
  • 30
  • 64
0

If you want to install GWT plugin then

  1. Click Help -> install new software-> then paste this link there (http://dl.google.com/eclipse/plugin/2.0) then Add->ok
  2. Select all
  3. Click Next->Finish

Try new plugins also. 4.2 is latest plugin and update eclipse also.

Parvathy
  • 2,007
  • 2
  • 22
  • 38