Guava: Difference between revisions
From charlesreid1
No edit summary |
No edit summary |
||
| Line 28: | Line 28: | ||
$ java -cp '.:/path/to/guava/jars/guava-21.0.jar' TSP | $ java -cp '.:/path/to/guava/jars/guava-21.0.jar' TSP | ||
</pre> | </pre> | ||
[[Category:Java]] | |||
[[Category:Programming]] | |||
Revision as of 18:24, 23 March 2017
Guava is a Java library of high-performance collections and data containers. It was made and is maintained by Google.
The story behind Guava is, Google basically hired the author of the Java Collections API to go nuts and build a Collections++ library.
Google Guava on Github: https://github.com/google/guava
Installing
Jar File
Probably the easiest way to install Guava is to use the Guava jar file. You can find the link to Guava distributed as a Jar file on the Guava wiki on Github: https://github.com/google/guava/wiki/Release21
Using the Jar file depends on your environment, most IDEs have an easy way to add Jar files to a project.
If you're compiling by command line, you'll need to specify the Java class path and point Java to the location of your Jar files.
Class Path
To pass a custom class path with the location of your Guava jar files to the compiler,
$ javac -cp '.:/path/to/guava/jars/guava-21.0.jar' TSP.java
Then run Java with the same flag:
$ java -cp '.:/path/to/guava/jars/guava-21.0.jar' TSP