When compiling a GWT webapp with the GWT Maven Plugin, you might encounter an exception such as
java.lang.NoSuchFieldError: warningThreshold
The reason is having ECJ in your classpath with a version different from what GWT includes. Unfortunately, GWT’s version is not repackaged and thus clashes with other versions. The quick fix is setting the gwtSdkFirstInClasspath configuration option for the gwt-maven-plugin (available since 2.1.0-1, see this issue):
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.1.0-1</version>
<configuration>
...
<gwtSdkFirstInClasspath>true</gwtSdkFirstInClasspath>
</configuration>
Wow~~~~~~ Thanks, Thanks…… very very much !!!!!
Worked like magic, thanks!
Thanks!
Pingback: java.lang.NoSuchFieldError when compiling GWT project | RoboMemory