Sometimes, you get an error like this:
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Maps
at com.google.gdata.wireformats.AltRegistry.<init>(AltRegistry.java:118)
at com.google.gdata.wireformats.AltRegistry.<init>(AltRegistry.java:100)
at com.google.gdata.client.Service.<clinit>(Service.java:555)
at sample.contacts.ContactsExample.<init>(ContactsExample.java:133)
at sample.contacts.ContactsExample.main(ContactsExample.java:609)
It means you’re missing a class, specifically com.google.common.collect.Maps.
Let’s say you download a package and get a million jars. How do you know if that class is in the jars and which one?
Try this linux script:
for i in *.jar; do jar -tvf "$i" | fgrep Maps; done
(note the quotes need to be regular quotes, and not the stylized ones WordPress imposes on me here)
If it’s found, you can print out all the classes in the jars into a text file and scan through it for the jar that contains your class
for i in *.jar;
do echo "$i" >> myjarcontents.txt;
jar -tvf "$i" >> myjarcontents.txt;
done