I am developing a RESTful's Webservice on java using Eclipse with the next steps:
File>New>Dynamic Web Project
Then I configured these options:
Target runtime: Apache Tomcat v7.0;
Dynamic web module version: 2.5 (because I am using Axis2);
Configuration: Default Configuration for Apache Tomcat v7.0 and (both options)
In label "Modify" I added "Axis2 Web Services" and "JAX-RS (REST Web Services)"
Next, when I created my new class, I added
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
but Eclipse launches the notice
The import javax.ws cannot be resolved
I don't know the next question
Import the jar file: javax.ws.rs-api-2.0.jar And add it to java build path. The issue will be resolved in windows.
Import the jar file: javax.ws.rs-api-2.0.jar And add it to java build path. The issue will be resolved in windows.
Link to the jar : http://www.java2s.com/Code/Jar/j/Downloadjavaxwsrsapi20jar.htm
Information on importing it to Eclipse : http://tech.amikelive.com/node-269/eclipse-quick-tip-resolving-error-the-import-javaxservlet-cannot-be-resolved/comment-page-1/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With