I try to use Google Calendar API Java library, and copy this code from example:
CalendarService myService = new CalendarService("abc");
try {
myService.setUserCredentials("авaea@gmail.com", "1111223");
} catch (AuthenticationException e) {
// TODO Auto-generated catch block
}
I downloaded library from source: gdata-client-1.0, gdata-calendar-2.0, but I got errors:
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 Test.main(Test.java:29)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Maps
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 4 more
Where can I do mistake?
The mentioned class is not found in the runtime classpath. The mentioned class is part of Guava. So, if you download and put it in the runtime classpath as well, then this error should disappear.