adam bien's blog

From zero to Java EE 5 app - in few minutes (on a fast machine :-)) 📎

I'm often asked, how to start with Java EE 5 with minimal setup/environment. In the world of Java there in general several options available - which is a good thing. However, you have to start somehow and refine your environment later. The easiest way (minimal amount of mouse-clicks), is the following:

  • Buy a mouse with a good, right button :-) 

This downloads netbeans with full Java EE support, as well as the production read reference implementation (Glassfish v2). It works with Netbeans 5.5.1 as well, but the editor of Netbeans 6.0 was improved significantly

  • In netbeans: Select Tab "Projects", right mouse click, Enterprise Projects -> Enterprise Application
  • Go to the "Bean Project" (EJB Module). right mouse click, select a "Session Bean". Implement a "Hello World" method with a return value (e.g. String sayHello()).
  • Go to the "Globe Project" (War). right mouse click, select a "Servlet". right mouse click -> Enterprise Resources ->  Call  Enterprise Bean.  Invoke the bean inside the method "processRequest"
  • Right click on the "Triangle Project" (EAR) right mouse click -> run. This can take several seconds/minutes. Netbeans starts the application server, deploys the application and opens the browser.
  • Close the IDE, Shutdown the machine -> and enjoy the weekend :-)
As you can clearly see -> the most important thing for Java EE 5 developers is the right mouse button :-).