Using Google Common Collection in GWT

guava, gwt, java

Solution

Hilbrand's answer didn't quite work (it gave me bunch of errors when Google collection classes were loaded), and I found another solution.

- Check out google collection - http://google-collections.googlecode.com/svn/trunk/

- Run the ant target "jargwt"

- Add the built jar file "google-collect-gwt-snapshot.jar" to your application's classpath.

- Add in your GWT application's module.

The reason Hilbrand's solution didn't work was because Google collection contains alot of gwt-incompaitable java files, and the Collect.gwt.xml module file selects ALL java file under Google Collection.

Problem

This is a simple problem, but I'm having problems with it... I'm trying to use Google common collection's `Objects.equal()` method in a GWT client code, but I'm keep getting the error 20:12:10.001 [ERROR] [gwt_regex] Line 39: No source code is available for type com.google.common.base.Objects; did you forget to inherit a required module? Tried to Google for the answer, but couldn't find any answer regarding this - everyone just said "Google collection should work off the box with GWT".

Original source