title: Jersey ClientBuilder.newClient(): source not found
body: <p>I have an Java 64-bit Eclipse application with Eclipse running on Windows 7 Pro x64.</p>
  
  <p>I downloaded the <a href="https://jersey.java.net" rel="noreferrer">Jersey</a> bundle, jaxrs-ri-2.7.zip, for client RESTful API access.</p>
  
  <p>I added these external jars (Project | Build Path | Configure Build Path... | Libraries):</p>
  
  <pre><code>jaxrs-ri/api/javax.ws.rs-api-2.0.jar
  jaxrs-ri/lib/jersey-client.jar
  jaxrs-ri/lib/jersey-common.jar
  </code></pre>
  
  <p>Here is the source:</p>
  
  <pre><code>package prjTestJersey;
  
  import javax.ws.rs.client.Client;
  import javax.ws.rs.client.ClientBuilder;
  
  public static void main(String[] args)
  {
      try
      {
          Client oClient = ClientBuilder.newClient();
  
          oClient.close();
      }
      catch (Exception e)
      {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>I receive the following error, when stepping over the first line, Clinet oClient...:</p>
  
  <pre><code>Source not found.
  </code></pre>
  
  <p>Why the error and how do I fix it? Why "source not found" instead of a real error.</p>
  
  <p>Note: I tried copying the 3 jar files to the project's lib folder, but that did not do any good. I am using the Eclipse debugger, so pressing F11 in debug view and then doing an F6 over the line.</p>
  
  <p>UPDATE:</p>
  
  <p>I tried creating a brand new 32-bit application (WindowBuilder SWT application window) and simply updated main(...), and same problem. That means the problem is platform independent.</p>
  
  <p>UPDATE 2:</p>
  
  <p>The posted answer to try running was not a bad idea. :-) That gave another clue, which I have to track down. Here is the dump.</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/glassfish/hk2/utilities/binding/AbstractBinder
      at org.glassfish.jersey.client.ClientConfig.&lt;init&gt;(ClientConfig.java:452)
      at org.glassfish.jersey.client.JerseyClientBuilder.&lt;init&gt;(JerseyClientBuilder.java:94)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      at java.lang.reflect.Constructor.newInstance(Unknown Source)
      at java.lang.Class.newInstance(Unknown Source)
      at javax.ws.rs.client.FactoryFinder.newInstance(FactoryFinder.java:116)
      at javax.ws.rs.client.FactoryFinder.find(FactoryFinder.java:206)
      at javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:86)
      at javax.ws.rs.client.ClientBuilder.newClient(ClientBuilder.java:114)
      at AppMain.main(AppMain.java:20)
  Caused by: java.lang.ClassNotFoundException: org.glassfish.hk2.utilities.binding.AbstractBinder
      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)
      ... 12 more
  </code></pre>
  
  <p>FINAL ANSWER:
  (Thanks to both answers for the help.)</p>
  
  <p>I was missing dependencies. The needed list is:</p>
  
  <pre><code>swt_win32_x86.jar
  api/javax.ws.rs-api-2.0.jar
  ext/jersey-guava-2.7.jar
  ext/hk2-api-2.2.0.jar
  lib/jersey-common.jar
  lib/jersey-client.jar
  </code></pre>