You may want to consider using Java EE, which includes the javax.servlet.*
packages. If you require a specific version of the servlet api, for instance to target a specific web application server, you will probably want the Java EE version which matches, see this version table.