0
我試圖運行Google Data API附帶的示例程序。我得到一個運行時錯誤在以下行Google數據api for youtube
YouTubeService myService = new YouTubeService("gdataSample-YouTube-1");
的錯誤是:
run:
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 YouTubeReadonlyClient.main(YouTubeReadonlyClient.java:713)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Maps
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 4 more
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
我都嘗試谷歌數據API版本1.35.0和1.35.1,我得到了同樣的錯誤這兩種情況。
我試着從http://code.google.com/p/gdata-java-client/source/browse/#svn/trunk/java/deps下載google-collect-1.0-rc1.jar ,但是當該網站顯示的實際大小爲535 kb時,我得到的文件只有32 kb 當我可以獲取此文件時是否還有其他位置? 你可以郵寄給我。我的電子郵件ID是[email protected] – user93796 2009-08-11 08:49:56
您無需單獨下載它 - 它位於GData API zip文件中。 – 2009-08-11 08:58:51