Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Guava libraries and GWT

Tags:

java

guava

gwt

Just discovered the Guava libraries project.

Do these work with GWT?

like image 709
jldupont Avatar asked Jan 05 '10 11:01

jldupont


People also ask

What is guava GWT?

Guava is a suite of core and expanded libraries that include utility classes, Google's collections, I/O classes, and much more. This project includes GWT-friendly sources.

What is the use of guava library?

Guava is an open-source “Collection Library” library for Java, developed by Google. It provides utilities for working with Java collections. As you dive deep into Guava you'll notice how it reduces coding errors, facilitates standard coding practices and boost productivity by making code concise and easy to read.

What is guava JRE?

guava and its artifact ID is guava . Guava provides two different “flavors”: one for use on a (Java 8+) JRE and one for use on Android or Java 7 or by any library that wants to be compatible with either of those. These flavors are specified in the Maven version field as either 31.1-jre or 31.1-android .


2 Answers

Here are some more details on how to accomplish this with the (currently latest) 19.0 release of Guava.

  1. The Guava release consists of two JARs, guava-19.0.jar and guava-gwt-19.0.jar. You will need both for getting Guava to work within your GWT project. (In a non-GWT project you will only need the former.) Download them and add them to your project; if you use Maven, use these dependencies:

    <dependency>     <groupId>com.google.guava</groupId>     <artifactId>guava</artifactId>     <version>19.0</version> </dependency> <dependency>     <groupId>com.google.guava</groupId>     <artifactId>guava-gwt</artifactId>     <version>19.0</version> </dependency> 

    Maven will then automatically download the two Jars from the Central Maven Repository, see also the Guava page on mvnrepositories. As an SBT user, you would go for something like libraryDependencies += "com.google.guava" % "guava" % "19.0".

  2. Add

      <inherits name="com.google.common.collect.Collect"/> 

    to your GWT module file to enable Guava.

like image 96
Hbf Avatar answered Sep 22 '22 06:09

Hbf


In the future, we'll release a working GWT module covering the @GwtCompatible subset of the library. Stay tuned.

like image 25
Kevin Bourrillion Avatar answered Sep 21 '22 06:09

Kevin Bourrillion