At least in NetBeans, when you set up a type of "project," the base
libraries are put on your compile path. For example, when you choose
"Web Application," you don't have to do anything else to extend for
example HttpServlet.
I seem to remember that. I haven't used NetBeans for a couple of years,
and even then it was for a desktop app (a socket server actually). So
it's likely been 3 or 4 years since I fired up a web or full J2EE app on NB.
I do actually keep up with NetBeans dev. I have 6.9 and/or 7 installed
on two boxes right now, just in case. The reason I barely use it is
because no clients in the last 3 or 4 years have...it's almost always
Eclipse. I try to evangelize a bit but it's tough slogging.
If this is the answer, then it is indeed a bit weird for someone from a
NetBeans background. Hopefully, you're answering about the compile-time
environment and not the run-time.
Well, compile time and run time, it's somewhat indistinguishable. If
you're writing J2EE/Java EE with a typical app server there's the
expectation that most of your core stack is going to be supplied by the
server, not by the WAR/JAR/EAR. So your compile time requirements for
core Java EE APIs, and for your JSF, and for your persistence, and so
forth, are supplied by the server libraries - otherwise you are
maintaining two sets of dependencies.
(NetBeans comes with a server, Glassfish, by default if you get the
"full Monty" (<-- air quotes), so perhaps that is why you don't have to
explicitly install one in NB. It always has at least one server to
compile against.)
That's the difference, and Glassfish (or specific variants thereof) is
the Java EE reference implementation besides. Eclipse (at least all the
versions I've used) has elected not to include a server, but it does
have an easy-to-use server plugin system that handles most of the app
servers out there - you yourself obtain and unpack the server distro,
and the Eclipse server plugin for server X simplifies the process of
making Eclipse aware of it. I can typically set up and configure Eclipse
for Tomcat or JBoss or oc4j or whatever inside 5 minutes, once the
server distro is unpacked.
I have no objections to either approach, NetBeans or Eclipse. The
Eclipse approach is more realistic for me, as no client my company has,
has had, or ever will have, uses or will use Glassfish.
So it's best
for me to go through the initial upfront setup for OAS or Websphere or
JBoss first on any given project. YMMV.
AHS
--
Governor Thomas was so pleas'd with the Construction of this Stove, as
describ'd in it, that he offer'd to give me a Patent for the sole
Vending of them for a Term of Years; but I declin'd it from a Principle
which has ever weigh'd with me on such Occasions, viz. That as we enjoy
great Advantages from the Inventions of Others, we should be glad of an
Opportunity to serve others by any Invention of ours, and this we should
do freely and generously.
-- Benjamin Franklin