Monday, February 17, 2014

Gradle Dependencies Error

src\main\java\com\package\HelloWorldServlet.java:5: error: package javax.servlet does not exist
import javax.servlet.ServletException;
OR
error: cannot find symbol
public class HelloWorldServlet extends HttpServlet {

When we get any one of the above error there must be a problem of missing depencies in gradle. In this case I missed the below line. providedCompile 'javax.servlet:servlet-api:2.5'

The complete code:

dependencies {
   providedCompile 'javax.servlet:servlet-api:2.5' //I missed this line.
}

No comments:

Post a Comment