Reputation: 751
We inherited an old application which still runs on JDK 7. We want to use JDK 8 but for some weird reason the tests don't work anymore when building with JDK 8. It starts to complain that certain anonymous classes cannot be found:
java.lang.NoClassDefFoundError: com/some/package/client/widget/SomeClass$1
I read somewhere that you shouldn't use anonymous classes with GWT and JDK 8. I tried changing that but still it keeps complaining that it cannot find the class :-(.
Collections.sort(objects, new Comparator<ClientObject>() {
public int compare(ClientObject object1, ClientObject object2) {
int result = 0;
if ((object1 != null) && (object2 != null)) {
result = object1.getTranslation().compareTo(object2.getTranslation());
}
return result;
}
});
The code block above is the culprit it seems. But have no idea why. I also tried upgrading to newer versions of GWT but that causes other NoClassDefFoundError errors during test. Does anybody know what we are doing wrong?
For the test cases we use gwt-test-utils.
Upvotes: 1
Views: 67