我只是想让一些事情发挥作用,这样我就可以尝试一些谷歌应用程序引擎java。然而我似乎有一些问题,我无法掌握。
java代码如下所示:
import java.net.URL;
import com.google.gdata.client.photos.*;
import com.google.gdata.data.photos.*;
public class TestPicasa {
public static void main(String[] args) {
try {
PicasawebService service = new PicasawebService("Picasa test");
service.setUserCredentials("username@gmail.com", "password");
URL feedURL = new URL("http://picasaweb.google.com/data/feed/api/user/username?kind=album");
UserFeed feed = service.getFeed(feedURL, UserFeed.class);
for (AlbumEntry entry : feed.getAlbumEntries()) {
System.out.println(entry.getTitle().getPlainText());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
我根据 google 的指示引用了 mail.jar、activation.jar、servlet-api.jar、gdata-client、gdata-client-meta、gdata-core、gdata-media、gdata-photos-2.0.jar 和 gdata-photos-meta-2.0.jar .
我在控制台收到此错误:
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:532)
at TestPicasa.main(TestPicasa.java:10)
知道我错过了什么吗?
最佳答案
关于java - 如何解决此 PicasawebService 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1215644/