У меня есть клиент на майке.У меня есть следующий импорт в клиентском классе
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;
Когда я компилирую приложение, я получаю
./src/com/uciext/ws/class2/client/StudentClient.java:3: error: package javax.ws.rs.client does not exist
import javax.ws.rs.client.Client;
^
Как я могу решить проблему
РЕДАКТИРОВАНИЕ:
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
Это ч.ш.Я использую майку 2.2.7.Я скачал майку 2.2.7 и скопировал ее в мою папку lib.Могу ли я иметь неправильную версию банки.
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