title: Jersey client javax.ws.rs.client.Client not found
body: <p>I have a jersey client. I have the following imports in the client class</p>
  
  <pre><code>import javax.ws.rs.client.Client;
  import javax.ws.rs.client.ClientBuilder;
  import javax.ws.rs.client.Entity;
  import javax.ws.rs.client.Invocation;
  import javax.ws.rs.client.WebTarget;
  import javax.ws.rs.core.MediaType;
  import javax.ws.rs.core.Response;
  </code></pre>
  
  <p>When I compile the application I get</p>
  
  <pre><code>./src/com/uciext/ws/class2/client/StudentClient.java:3: error: package javax.ws.rs.client does not exist
  import javax.ws.rs.client.Client;
                           ^
  </code></pre>
  
  <p>How can I fix the issue</p>
  
  <p>EDITED:</p>
  
  <pre><code>This is the error trace
  
  ./src/com/uciext/ws/hw2/client/InventoryClient.java:4: error: package javax.ws.rs.client does not exist
  import javax.ws.rs.client.Client;
                           ^
  ./src/com/uciext/ws/hw2/client/InventoryClient.java:5: error: package javax.ws.rs.client does not exist
  import javax.ws.rs.client.ClientBuilder;
                           ^
  ./src/com/uciext/ws/hw2/client/InventoryClient.java:6: error: package javax.ws.rs.client does not exist
  import javax.ws.rs.client.Entity;
                           ^
  ./src/com/uciext/ws/hw2/client/InventoryClient.java:7: error: package javax.ws.rs.client does not exist
  import javax.ws.rs.client.Invocation;
                           ^
  ./src/com/uciext/ws/hw2/client/InventoryClient.java:8: error: package javax.ws.rs.client does not exist
  import javax.ws.rs.client.WebTarget;
                           ^
  ./src/com/uciext/ws/hw2/client/InventoryClient.java:9: error: package javax.ws.rs.core does not exist
  import javax.ws.rs.core.MediaType;
                         ^
  ./src/com/uciext/ws/hw2/client/InventoryClient.java:10: error: package javax.ws.rs.core does not exist
  import javax.ws.rs.core.Response;
                         ^
  ./src/com/uciext/ws/hw2/client/InventoryClient.java:15: error: cannot find symbol
           Client client = ClientBuilder.newClient();
           ^
    symbol:   class Client
    location: class InventoryClient
  ./src/com/uciext/ws/hw2/client/InventoryClient.java:15: error: cannot find symbol
           Client client = ClientBuilder.newClient();
                           ^
    symbol:   variable ClientBuilder
    location: class InventoryClient
  ./src/com/uciext/ws/hw2/client/InventoryClient.java:16: error: cannot find symbol
           WebTarget myResource = client.target("http://127.0.0.1:8080/inventory/rest/catalog");
           ^
    symbol:   class WebTarget
    location: class InventoryClient
  ./src/com/uciext/ws/hw2/client/InventoryClient.java:17: error: package Invocation does not exist
           Invocation.Builder builder = myResource.request(MediaType.TEXT_PLAIN);
                     ^
  ./src/com/uciext/ws/hw2/client/InventoryClient.java:17: error: cannot find symbol
           Invocation.Builder builder = myResource.request(MediaType.TEXT_PLAIN);
                                                           ^
    symbol:   variable MediaType
    location: class InventoryClient
  12 errors
  </code></pre>
  
  <p>This is the c.sh. I use jersey 2.2.7. I downloaded jersey 2.2.7 and copied it in my lib folder. Can I have the wrong version of jar.</p>
  
  <pre><code>JAXB_PATH=./lib/jaxb-ri-2.2.7/lib
  JAXB_LIB=$JAXB_PATH/jaxb-api.jar:$JAXB_PATH/jaxb-core.jar:$JAXB_PATH/jaxb-impl.jar:$JAXB_PATH/jaxb-jxc.jar:$JAXB_PATH/jaxb-xjc.jar
  JAXRS_PATH=./lib/jaxrs-ri/lib
  JAXRS_API=./lib/jaxrs-ri/api
  JAXRS_LIB=$JAXRS_PATH/jersey-server.jar:$JAXRS_PATH/jersey-common.jar:$JAXRS_PATH/jersey-container-servlet.jar:$JAXRS_PATH/jersey-container-servlet-core.jar:$JAXRS_API/javax.ws.rs-api-2.0.jar
  CLASSPATH=$CLASSPATH:./lib/jaxrs-ri/api
  CLASSPATH=$CLASSPATH:./lib/jaxb-ri-2.2.7/lib
  CLASSPATH=$CLASSPATH:./lib/jaxrs-ri/lib
  javac -classpath $JAXB_LIB:$JAXRS_LIB:. -d classes ./src/com/uciext/ws/hw2/util/*.java ./src/com/uciext/ws/hw2/backend/model/*.java ./src/com/uciext/ws/hw2/backend/*.java ./src/com/uciext/ws/hw2/backend/impl/*.java ./src/com/uciext/ws/hw2/service/model/catalog/*.java ./src/com/uciext/ws/hw2/service/model/order/*.java ./src/com/uciext/ws/hw2/service/model/orderconfirm/*.java ./src/com/uciext/ws/hw2/service/*.java ./src/com/uciext/ws/hw2/service/impl/*.java
  javac -classpath $JAXB_LIB:$JAXRS_LIB:. -d classes ./src/com/uciext/ws/hw2/client/model/catalog/*.java ./src/com/uciext/ws/hw2/client/model/order/*.java ./src/com/uciext/ws/hw2/client/model/orderconfirm/*.java ./src/com/uciext/ws/hw2/client/*.java 
  </code></pre>