Using guava and GWT
Someone can tell me what needs to be done to enable guava support in GWT
I have downloaded guava R07, where there are the following two files:
>Guava R07 jar > guava-r07-gwt. jar
I have a few questions:
>Where are these documents going? I guess the standard jar is the code that can be used in my IDE, and both are provided to the GWT compiler to build JavaScript? > I need to put - GWT Jar gwt. Add the GWT. XML file to the main GWT. XML file of my project XML file, or just what I need? > There are other pots on the trunk of guava and GWT projects that I think may be needed (i.e. no download, such as jsr305), but I'm not sure
Sorry, usually I don't have trouble with this kind of thing, but I can't solve what and where well
I am currently using GWT 1.6, but I hope to get to No. 2 soon If guava is not compatible with 1.6, that's not a problem
to update
I have the following files in a folder called gwtlib:
> guava-r07-gwt. Jar > guava R07 jar > jsr305-1.3. 9.jar
My ant script does the following:
<path id="project.class.path"> <fileset dir="gwtlibs" includes="guava-r07.jar"/> <fileset dir="gwtlibs" includes="guava-r07-gwt.jar"/> <fileset dir="gwtlibs" includes="jsr305-1.3.9.jar"/> <pathelement location="${gwt.sdk}/gwt-user.jar"/> <fileset dir="${gwt.sdk}" includes="gwt-dev*.jar"/> </path> <target name="gwtc"> <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler"> <classpath> <pathelement location="app"/> <path refid="project.class.path"/> </classpath> <jvmarg value="-Xmx256M"/> <arg value="-localWorkers"/> <arg value="2"/> <arg value="-war"/> <arg value="gwt-public"/> <arg value="Main"/> </java> </target>
Running the above command, I get the following error:
>Error line 254 in "jar: File: / / / project / gwtlibs / guava-r07-gwt. Jar! / COM / Google / common / collect / constraints. Java": Method sublist (int, int) is undefined for type list
Without the JSR jar on the classpath, I received the following error:
> import javax. Annotation cannot resolve > nullable cannot resolve to type
thank you
rich
Solution
Guava is not compatible with GWT 1.6 Especially list Sublist is added to GWT in GWT 2 The earliest version we fully support is GWT 2.0 four