I am trying to run a simple servlet program.
I have installed J2SE v6 on my computer and my compiler complains that it is not able to find package javax.servlet.* ;
The Servlet API is not part of Standard Edition Java. And if you are just interested in Servlets and JSP rather than all the other myriad EE technologies, you can just download a servlet container such as Tomcat and it will provide the necessary jar files. That will be a lot less confusing than all of JEE.
If you want to get into EJBs or other EE technologies (probably not, at this point), then you'll need JEE.
For the Eclipse IDE, you need to install a server runtime, like Apache Tomcat (servlets & jsp only) or Glassfish (full JEE stack).
There is an old article on installing Tomcat in Eclipse, but the information is still relevant. Installing Glassfish (or Geronimo), can be done in a similar manner, if you need a full JEE stack. Tomcat should be enough to solve your immediate issue.
OCPJP
In preparing for battle I have always found that plans are useless, but planning is indispensable. -- Dwight D. Eisenhower