2013-11-24 2 views
1

내 Picasa 앨범의 모든 앨범 목록을 나열하고 싶습니다. 여기에 코드가 있습니다.Java Picasa API 디렉토리 목록이 작동하지 않습니다.

import java.io.IOException; 
import java.net.MalformedURLException; 
import java.net.URL; 

import com.google.gdata.client.photos.PicasawebService; 
import com.google.gdata.data.photos.AlbumEntry; 
import com.google.gdata.data.photos.UserFeed; 
import com.google.gdata.util.AuthenticationException; 
import com.google.gdata.util.ServiceException; 


public class MyMain { 

    /** 
    * @param args 
    */ 
    public static void main(String[] args) { 
     // TODO Auto-generated method stub 
     System.out.print("hello"); 
     PicasawebService myService = new PicasawebService("exampleCo-exampleApp-1"); 
     try { 
      myService.setUserCredentials("[email protected]", "myPassWord"); 
     } catch (AuthenticationException e) { 
      // TODO Auto-generated catch block 
      e.printStackTrace(); 
     } 
     URL feedUrl=null; 
     try { 
      feedUrl = new URL("https://picasaweb.google.com/data/feed/api/user/myMailAddress?kind=album"); 
     } catch (MalformedURLException e) { 
      // TODO Auto-generated catch block 
      e.printStackTrace(); 
     } 

     UserFeed myUserFeed=null; 
     try { 
      myUserFeed = myService.getFeed(feedUrl, UserFeed.class); 
     } catch (IOException e) { 
      // TODO Auto-generated catch block 
      e.printStackTrace(); 
     } catch (ServiceException e) { 
      // TODO Auto-generated catch block 
      e.printStackTrace(); 
     } 

     for (AlbumEntry myAlbum : myUserFeed.getAlbumEntries()) { 
      System.out.println(myAlbum.getTitle().getPlainText()); 
     } 

    } 

} 

그러나 예외가 발생됩니다 :

helloException in thread "main" java.lang.NoClassDefFoundError: javax/mail/MessagingException at MyMain.main(MyMain.java:20) Caused by: java.lang.ClassNotFoundException: javax.mail.MessagingException at java.net.URLClassLoader$1.run(Unknown Source) 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) ... 1 more

도와주세요.

답변

0

하면 항아리를 찾을 수있는 더 나은를 설명해야 mail.jar, activation.jar을하고 additional.jar

+0

을 추가하는 방법을 클래스 패스에 넣어하기 – Shine