title: Using Drive API with Java
body: <p>I am following Google Documentation to upload a file to Google Drive on windows with Java, but I have an error in the following line that I cannot figure out why I have it!
  <a href="https://developers.google.com/drive/v2/reference/files/insert" rel="nofollow">https://developers.google.com/drive/v2/reference/files/insert</a></p>
  
  <pre><code>File file = service.files().insert(body, mediaContent).execute();
  </code></pre>
  
  <p>I have all the .jar files needed, the error is:</p>
  
  <pre><code>Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
      The method insert(File, FileContent) is undefined for the type Drive.Files
  </code></pre>
  
  <p>When I move the cursor close to insert, it says Add cast to service.files()</p>
  
  <p>Can someone help me please? 
  The code I have is exactly like the documentation (if scroll down the link I provided pls)</p>
  
  <p>Thanks for helping.</p>