J(2)EE libraries are defined on the project properties Build Path tab. In my case, I built a user library named TOMCAT and added Tomcat's servlet-api.jar and jsp-api.jar to it. My Tomcat webapp projects then include this library on their Build Path.
If you use the custom project builders/facets on Eclipse and it's a version with the
JEE plugins installed (
e.g., the Eclipse J2EE spin), then they probably do something similar behind the scenes. Also, I've noted that
Maven has the ability to hook into the build path. And most of my serious projects have Maven build capabilities.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.