2012-10-24 2 views
2

나는 GDATA 자바 라이브러리이 샘플 코드를 실행하는 데 문제 :인 Gdata API 블로거 예를

import java.net.URL; 
import com.google.gdata.client.Query; 
import com.google.gdata.client.blogger.BloggerService; 
import com.google.gdata.data.Feed; 

public class AccessBloggerSample { 

public static void main(String[] args) throws Exception { 
    BloggerService service = new BloggerService("Testing-Blogger"); 
    service.setUserCredentials("[email protected]", "XXX"); 
    System.out.println("Google: " + BloggerService.getVersion()); 
    URL feedUrl = new URL("http://minhchaunyc.blogspot.com/feeds/posts/default "); 
    Query query = new Query(feedUrl); 
    System.out.println("service: "); 
    Feed resultFeed = service.getFeed(query, Feed.class); 
    System.out.println("blogs: " + resultFeed.getEntries().size()); 
    } 
} 

을 그리고 난 다음 오류 얻을 : 나는

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 AccessBloggerSample.main(AccessBloggerSample.java:23) 
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Maps 
at java.net.URLClassLoader$1.run(URLClassLoader.java:366) 
at java.net.URLClassLoader$1.run(URLClassLoader.java:355) 
at java.security.AccessController.doPrivileged(Native Method) 
at java.net.URLClassLoader.findClass(URLClassLoader.java:354) 
at java.lang.ClassLoader.loadClass(ClassLoader.java:423) 
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) 
at java.lang.ClassLoader.loadClass(ClassLoader.java:356) 
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 AccessBloggerSample.main(AccessBloggerSample.java:23) 
at __SHELL0.run(__SHELL0.java:6) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:601) 
at bluej.runtime.ExecServer$3.run(ExecServer.java:724)` 

어떤 아이디어를 얻고 왜 이? BlueJ를 통해 코드를 컴파일하고 실행 중이며 모든 jar 파일을 BlueJ의 lib 디렉토리에 압축을 풀었습니다.

답변