Tuesday, March 2, 2010

How to Setup Java EE Web Development Environment on Eclipse IDE

Setting up a Java EE Web project like Cyclos in Eclipse IDE can be confusing at times. Here I'll show you how.

You need to get Eclipse Java EE Edition or SpringSource Tool Suite. I recommend SpringSource Tool Suite since it contains essential Java EE environment plus enterprise-grade Tomcat (SpringSource tc Server).
  1. Get the Cyclos distribution with sources here 
  2. In Eclipse/STS, File > New > Create a Dynamic Web Project
    - Under Project contents. Uncheck "use defaults" and choose your Cyclos root directory.
    - Target runtime: Tomcat (default)
    - Dynamic web module version: 2.5
    - Configuration: Default Configuration for Apache Tomcat v6.0 3.
  3. Click Next until you get to "Web Module" page.
    - For web module content directory, change to "web".
    - Uncheck "Generate web.xml deployment descriptor".
    - Finish
 It'll start rebuilding the project and the longest process is Validating JSPs...

Although I did the above process for Cyclos project, it can be used for any web project, as long as you recognize the structure (the most important is where the Java sources directory and the webapp directory).

Good luck!

For further resource on Java EE Web Development with Eclipse, get The Java Developer's Guide to Eclipse, 2nd Edition.