Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT/ Eclipse: ClassNotFoundException com/google/gwt/dev/Compiler

i recently updated from GWT 2.0.4 to 2.1.0. Since then I cannot compile my GWT application anymore. When I click on the GWT compile button of the GWT eclipse plugin I get the following error:

java.lang.NoClassDefFoundError: com/google/gwt/dev/Compiler
Caused by: java.lang.ClassNotFoundException: com.google.gwt.dev.Compiler
 at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Exception in thread "main"

Also I can't create a new GWT project in Eclipse. In the new New Web Application Project Dialog one can choose to use GWT and/or Google App Engine. When check "Use GWT" a error dialog raises up which says: "Creation of element failed. Reason: Invocation of com.google.gwt.user.tools.WebAppCreator failed. See the error log for more details."

In the log file (<workspace>/.metadata/.log) I can see the message:

!ENTRY org.eclipse.jdt.ui 4 10001 2010-11-02 08:34:50.085
!MESSAGE Internal Error
!STACK 1
Java Model Exception: Core Exception [code 0] Invocation of com.google.gwt.user.tools.WebAppCreator failed. See the error log for more details.
 at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:50)
 at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
 at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
 at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4777)
 at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:106)
 at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.core.runtime.CoreException: Invocation of com.google.gwt.user.tools.WebAppCreator failed. See the error log for more details.
 at com.google.gwt.eclipse.core.runtime.tools.WebAppProjectCreatorRunner.createProject(WebAppProjectCreatorRunner.java:53)
 at com.google.gdt.eclipse.suite.wizards.WebAppProjectCreator.createGWTProject(WebAppProjectCreator.java:532)
 at com.google.gdt.eclipse.suite.wizards.WebAppProjectCreator.create(WebAppProjectCreator.java:294)
 at com.google.gdt.eclipse.suite.wizards.NewWebAppProjectWizard.finishPage(NewWebAppProjectWizard.java:147)
 at org.eclipse.jdt.internal.ui.wizards.NewElementWizard$2.run(NewElementWizard.java:117)
 at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
 at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
 at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
 at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4777)
 at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:106)
 at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
!SUBENTRY 1 com.google.gwt.eclipse.core 4 0 2010-11-02 08:34:50.085
!MESSAGE Invocation of com.google.gwt.user.tools.WebAppCreator failed. See the error log for more details.

gwt-dev.jar, gwt-user.jar and many other google-jars are in the classpath...

Does anyone have an idea how to solve this issue? I also set up a new fresh Eclipse installation, installed the new GWT plugin, and chose a new workspace directory, but this still gives me the errors...

Additional information:

  • Windows XP,
  • Eclipse for Java EE 3.6 Helios,
  • J2EE / Java 1.6.0_22-b04
  • Google Plugin for Eclipse 3.6 1.4.0.v201010280102,
  • Google App Engine Java SDK 1.3.8 1.3.8.v201010161055
  • Google Web Toolkit SDK 2.1.0 2.1.0.v201010280102
like image 746
hage Avatar asked Nov 02 '10 08:11

hage


People also ask

Is GWT still supported?

Officially, support is dropped for running the GWT compiler or server-side tooling on Java 7.

What is GWT compiler?

The heart of GWT is a compiler that converts Java source into JavaScript, transforming your working Java application into an equivalent JavaScript application. The GWT compiler supports the vast majority of the Java language. The GWT runtime library emulates a relevant subset of the Java runtime library.


2 Answers

I had the same problem not being able to create a new GWT-project in Eclipse. Removing the Classpath variable from my windows environment variables (appearently interfering with the settings in Eclipse) solved the problem for me.

like image 138
Jandar Avatar answered Sep 28 '22 17:09

Jandar


In my case the jar (gwt-dev-2.1.0.jar) downloaded from the google maven repo was corrupt! I replace the jar in my repo with a one containing the classes and mvn gwt:run worked!

hope this helps.

like image 43
guido Avatar answered Sep 28 '22 17:09

guido