If possible which class path setting is involved?
In addition to the regular Java SDK you will need the servlet specific class library on the classpath in order to compile.
Most programmers new to servlets download and install the free
Tomcat web server / servlet container. It will include the needed library and many useful examples plus extensive documentation.
Bill