javaEEApplication facet and downloading required library ?

IDEA 11, Mac OS X Lion, JDK 1.6


I was under the impression that once I add javaEEapplication support to my module, using the facet selection, IDEA should automatically download the required files like the servlet-api.jar  required to write servlets.  This is per the documentation

This didn't happen, neither on a new project nor after I had a java module and wanted to add this facet.   When I created a class that extended HttpServlet, even the code helper (Fix) light bulb didn't give me an option to import the javax.* classes necessary for HttpServlet.

Only after I added my installed  tomcat6.0/lib directory to my global library did the code helper (Fix) light bulb gave me the option to add HttpServlet to my imports.

Isn't that what the facet is supposed to do or am I missing something.


1 comment
Comment actions Permalink

Automatic downloading of JavaEE jars indeed was switched off some time ago. The reason was that these jars aren't always necessary (e.g. you can use
some web framework and don't write servlets by hand) and these jars are available in an application server installation. If you select 'Application
Server' option in the last page of 'New Module' wizard the corresponding jars will be automatically added to the dependencies list.

Also you can download JavaEE jars using a quick fix from the servlet code: put the cursor on an unresolved 'javax.servlet.*' reference in the code,
press Alt+enter and select 'Add JavaEE jars to module dependencies'.
Nikolay Chashnikov
Software Developer
JetBrains, Inc
"Develop with pleasure!"


Please sign in to leave a comment.