I\'m trying to use Guava in a GWT project without success (a HashMultimap, to be precise). I get a never-ending list of stacktraces for classes:
You need to obtain the JSR 305 JAR, but in addition, you need to include the @Nullable
annotation source code as food for the GWT compiler.
Assuming your project is under com/example/myproject/
Create a file: com/example/myproject/annotation/javax/annotation/Nullable.java
With the following content:
package com.example.myproject.annotation.javax.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import javax.annotation.Nonnull;
import javax.annotation.meta.TypeQualifierNickname;
import javax.annotation.meta.When;
@Documented
@TypeQualifierNickname
@Nonnull(when = When.UNKNOWN)
@Retention(RetentionPolicy.RUNTIME)
public @interface Nullable {
}
Add the line to MyProject.gwt.xml
:
And you're good to go.