Eclipse has its own classpath settings, and ignores the classpath from the external system.
With your project open in Eclipse, go to the "project" menu at the top. At the botton of that menu
you should see "properties". Click this to open the project properties browser dialog. On the left you should see a list of property groups. Click "Java Build Path" then select the "Libraries" tab.
You now need to click the "Add External JARs" button at the right of the dialog, and navigate the file opener to wherever your
servlet jar lives. Select the appropriate jar file and it will be added to the classpath for the Eclipse project.
You should then find that you can compile servlet code with no problem. All you need now is to get your code working