答案 0 :(得分:2)
这是因为您正在使用Jersey 2库,并且您正在尝试导入Jersey 1类。您可以看到用于Jersey 2的javax.ws.rs.client.Client is imported correctly. This is the
Client`您可以像
Client client = ClientBuilder.newClient();
WebTarget target = client.target(url);
Response response = target.request().get();
另见: