我尝试使用Google Calendar API Java库,并从示例中复制此代码:
CalendarService myService = new CalendarService("abc");
try {
myService.setUserCredentials("авaea@gmail.com", "1111223");
} catch (AuthenticationException e) {
// TODO Auto-generated catch block
}
我从源代码下载了库:gdata-client-1.0,gdata-calendar-2.0,但是我收到了错误:
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
我哪里可以搞错?