Chinmaya B Chinmaya B - 1 year ago 138
Java Question

javax.servlet.* cannot be resolved to a type

I am running ubuntu 14.04 and eclipse Kepler (with java ee modules preloaded) , I am developing Dynamic Web App for first time, it always says cannot be resolved to a type please help I am including a screen snapshot for my error page!

System Snapshot

Answer Source

Only two things are required in Eclipse for this:


In Eclipse, Window -> Preferences -> Server -> Runtime Environment
Specify your Web Server or Application Server path, by adding a "New Server Runtime Environment".

Server Runtime ENvironment List in Eclipse Preferences


In Project Properties (Right Click on Project -> Properties), in Java Build Path, add Library "Server Runtime". Adding this will add servlet-api.jar to project dependecies.

Add Server Runtime Library to Project

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download