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

僤鯓⒐⒋嵵緔 提交于 2019-11-30 20:25:53

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.

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.

I was facing a similar issue where I was getting constantly java.lang.NoClassDefFoundError: com/google/gwt/dev/Compiler. While searching around I realized that the gwt version was missing a file from inside the gwt-dev folder inside the gwt installation directory.

Actually, I am using maven and gwt 2.5.0 for my project, and I discovered that inside .m2\repository\com\google\gwt\gwt-dev\2.5.0 folder should exist four files in order for gwt compiler to work. Those are

  • gwt-dev-2.5.0.jar <-sometimes this is corrupted
  • gwt-dev-2.5.0.jar.sha1 <- this one was missing
  • gwt-dev-2.5.0.pom
  • gwt-dev-2.5.0.pom.sha1

Go to your Project Properties / Build Path there move the "GWT library" to the top of the BuildPath.

Now try to recompile again.

I just, remove and include again gwt-dev.jar and start to work.

I fix that problem doing this:

  • remove GWT lib from your project
  • update gwt plugins for eclipse
  • put the lib back in your project
  • Done

I had the same problem, some java program had been installed declaring a "ClassPath" environment variable, and invalidating the gwt plugin for ANY version of eclipse, from 3.6 (helios) to 4.2 (juno). Note that environment variables are case-insensitive in Windows OSs. Solution: eliminate the system/user variable declaration and declare the variable in a/the launch script for the concerned program.

My understanding is:

When GWT compiles a project, it needs the tool "com.google.gwt.dev.Compiler" (which has a "main" entry point); however, GWT does not use Eclipse project's "build path" setting to find the tool, instead, it looks at OS's "classpath" system variable.

So, I think the solution is to add "D:\Java\GWT\gwt-2.6.1\*;" (my case as example) into "classpath" and restart Eclipse. It works well for me since.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!