Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javax.ws.rs package

I am learning RESTful Web Services and all the tutorials use javax.ws.rs.* package. But with JDK 6 and JDK 7, my Eclipse doesn't seem to recognize javax.ws package. What am I missing here?

like image 883
user238021 Avatar asked Apr 04 '12 03:04

user238021


People also ask

What is javax WS RS package?

Package javax.ws.rsIdentifies the application path that serves as the base URI for all resource URIs provided by Path . Defines the media types that the methods of a resource class or MessageBodyReader can accept.

What is the use of JAX-RS?

Java™ API for RESTful Web Services (JAX-RS) is a programming model that provides a mechanism for developing services that follow Representational State Transfer (REST) principles. Using JAX-RS, development of RESTful services is simplified.

What is meant by JAX-WS and JAX-RS?

JAX-WS represents SOAP. JAX-RS represents REST.

What is javax WS RS core application?

Defines the components of a JAX-RS application and supplies additional metadata. A JAX-RS application or implementation supplies a concrete subclass of this abstract class. The implementation-created instance of an Application subclass may be injected into resource classes and providers using Context . java.


2 Answers

javax.ws.rs is not a JDK package; it is a server-side API that forms part of the Java EE specification. You would need to include a Java EE runtime on your classpath or source an implementation from a 3rd party if you're going the self-assembly route (e.g. using Tomcat.)

like image 116
McDowell Avatar answered Sep 27 '22 22:09

McDowell


You're may be missing Jersey installation, or something in your environment configuration. Try also installing Eclipse WPT. You can follow this tutorial, it covers prerequisites and basic installation procedures as well.

like image 27
tenorsax Avatar answered Sep 27 '22 21:09

tenorsax