title: Sample Google Calendar API - Pure Java
body: <p>I'm trying to setup a basic example that is documented here <a href="http://goo.gl/9WudGn" rel="nofollow">http://goo.gl/9WudGn</a></p>
  
  <p>I can't seem to run the application without getting one error or another.</p>
  
  <p>There are no error before I run it, but when I do I get the following runtime error.</p>
  
  <pre><code>java.lang.NoClassDefFoundError: org/mortbay/jetty/Handler
      at com.azinky.CalendarSample.authorize(CalendarSample.java:95)
      at com.azinky.CalendarSample.main(CalendarSample.java:107)
  Caused by: java.lang.ClassNotFoundException: org.mortbay.jetty.Handler
  </code></pre>
  
  <p>I then include two jar files in my classpath, <strong>jetty-6.1.26.jar</strong> and <strong>jetty-util-6.1.26.jar</strong></p>
  
  <p>Now I get another error at runtime</p>
  
  <pre><code>java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
      at com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver.getRedirectUri(LocalServerReceiver.java:98)
      at com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp.authorize(AuthorizationCodeInstalledApp.java:76)
      at com.azinky.CalendarSample.authorize(CalendarSample.java:95)
      at com.azinky.CalendarSample.main(CalendarSample.java:107)
  Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest
  </code></pre>
  
  <p>Do I need to have jetty installed on my machine in order to run this example? (The documentation doesn't say I need to)</p>
  
  <p>This is my full classpath</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;classpath&gt;
      &lt;classpathentry kind="src" path="src"/&gt;
      &lt;classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/&gt;
      &lt;classpathentry kind="lib" path="libs/google-api-client-1.19.0.jar"/&gt;
      &lt;classpathentry kind="lib" path="libs/google-oauth-client-1.19.0.jar"/&gt;
      &lt;classpathentry kind="lib" path="libs/google-http-client-1.19.0.jar"/&gt;
      &lt;classpathentry kind="lib" path="libs/jsr305-1.3.9.jar"/&gt;
      &lt;classpathentry kind="lib" path="libs/google-api-services-calendar-v3-rev92-1.19.0.jar"/&gt;
      &lt;classpathentry kind="lib" path="libs/google-http-client-jackson2-1.19.0.jar"/&gt;
      &lt;classpathentry kind="lib" path="libs/google-oauth-client-jetty-1.19.0.jar"/&gt;
      &lt;classpathentry kind="lib" path="libs/google-oauth-client-java6-1.19.0.jar"/&gt;
      &lt;classpathentry kind="lib" path="libs/jackson-core-2.1.3.jar"/&gt;
      &lt;classpathentry kind="lib" path="libs/jetty-6.1.26.jar"/&gt;
      &lt;classpathentry kind="lib" path="libs/jetty-util-6.1.26.jar"/&gt;
      &lt;classpathentry kind="output" path="bin"/&gt;
  &lt;/classpath&gt;
  </code></pre>