Compiling a servlet is nothing different than compiling a plain Java class.
So the answer to you question depends on how are compiling the servlet?
Do you use Ant? Any editor like Eclipse? Hand compile through command line?
You need to TellTheDetails.