tried to embed a google calendar code taken from https://developers.google.com/google-apps/calendar/quickstart/java but got the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/mortbay/jetty/Handler
at CalendarQuickstart.authorize(CalendarQuickstart.java:76)
at CalendarQuickstart.getCalendarService(CalendarQuickstart.java:89)
at CalendarQuickstart.main(CalendarQuickstart.java:101)
Caused by: java.lang.ClassNotFoundException: org.mortbay.jetty.Handler
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)
... 3 more
And the line was
Credential credential = new AuthorizationCodeInstalledApp(
flow, new LocalServerReceiver()).authorize("user");
Before that, I just copied the code from https://developers.google.com/google-apps/calendar/quickstart/java and created a Java project, and this two Jar files were missing
import com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp;
import com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver;
After importing these jar files, this error is received. Please, help
source
share