views:

893

answers:

3

i am trying to run the sample program which comes with google data api.I am geting a run time error at following line

YouTubeService myService = new YouTubeService("gdataSample-YouTube-1");

erroe is as follows :

run: Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Maps at com.google.gdata.wireformats.AltRegistry.(AltRegistry.java:118) at com.google.gdata.wireformats.AltRegistry.(AltRegistry.java:100) at com.google.gdata.client.Service.(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)

I tried both google data api 1.35.0 and 1.35.1 versions and i am geting the same error in both

+2  A: 

Looks like you don't have the collections library in your class path.

It's in the gdata/java/deps directory in the zip file. Include the google-collect-1.0-rc1.jar file in your classpath and you should be fine. (You may also need jsr305.jar - I'm not sure.)

Jon Skeet
i tried to download google-collect-1.0-rc1.jar ,from http://code.google.com/p/gdata-java-client/source/browse/#svn/trunk/java/deps, but i get a file of only 32 kb when the actual size shown on that site is 535 kbis there any other location when i can get this file?Can u mail it to me. my email id is [email protected]
You don't need to download it separately - it's in the GData API zip file.
Jon Skeet
A: 

need google-collect 1.0rc1.zip

nasif
A: 

do you remember how did you fix it? I have the same problem

roberto gonella