title: Java: Two jars in project with same class.
body: <p>I have a java project that is using two imported jars with the same class (<code>com.sun.mail.imap.IMAPFolder</code>).  Is there a way to explicitly say which jar to use when importing the class?  Using: </p>
  
  <pre><code>import com.sun.mail.imap.IMAPFolder; 
  </code></pre>
  
  <p>would seem to use the class in order of build path order but this does not seem to be the case for some reason causing </p>
  
  <pre><code>Exception in thread "main" java.lang.reflect.InvocationTargetException
          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:616)
          at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
  Caused by: java.lang.NoSuchMethodError: com.sun.mail.imap.IMAPFolder.idle()V
          at com.woodbury.GCM.HelperGmailMonitor.doEmail(HelperGmailMonitor.java:104)
          at com.woodbury.GCM.Launch.listen(Launch.java:16)
          at com.woodbury.GCM.Launch.main(Launch.java:10)
          ... 5 more
  </code></pre>
  
  <p>at runtime.  I am building the project in eclipse.  </p>