RESTFul Webservice批注中的问题

min*_*nil 3 java eclipse rest classpath jersey

我正在尝试使用Jersey编写RESTFul Web服务.

package sample.hello.resources;

@Path("/hello")
public class HelloResource  {   
    @GET
    @Produces({MediaType.TEXT_PLAIN})
    public String sayHello() {
        return "Hello Jersey";
    }
}
Run Code Online (Sandbox Code Playgroud)

我的Eclipse给出了所有注释的错误 - @Path, (Path cannot be resolved to a type)

我是否需要包含任何其他库或在Eclipse中配置项目?

sua*_*uat 8

似乎Path注释存在于jersey-core库中.我认为你应该在你的项目中包含该库