2.1 Tools and Servers for Java EE

A variety of tools are available for developing a Java EE application. Integrated Development Environments (IDEs) are particularly well suited for programming Java EE as well as for programming Java mobile and desktop applications; the most well-known are Eclipse (www.eclipse.org) and NetBeans (www.netbeans.org). In general, a normal text editor and the standard tools of the Java SE Development Kit (JDK) are sufficient. However, these options are not advisable when developing software professionally, since productivity is severely impacted by the absence of a number of helpful features.

Java EE applications are made available by and run on an application server.  Alongside commercial products like WebSphere (IBM) and WebLogic (Oracle), free application servers like Glassfish (Oracle’s reference implementation of Java EE) and the open source product JBoss AS from Red Hat have come to be widely used. The Java EE 7-certified implementation of JBoss AS has traded under the name WildFly since version 8.

It is useful for developers to be able to start a build of a Java EE project in its current state out of the IDE and deploy it on the application server of their choosing with more or less a single click. Here, IDEs offer proprietary solutions for different servers; alternatively, plug-ins for the respective IDEs have been made available by the makers of the application servers.

Maven (http://maven.apache.org/) is a technology that supports the creation and deployment of Java EE applications on various application servers and allows them to be integrated in virtually any IDE. Maven is a general configuration management tool for all Java-based projects and for Java EE projects in particular. The motivation for creating Maven arose from the observation that every Java project to date had been accompanied by a large number of custom build scripts and that the intelligibility of each project therefore had to be addressed separately. A lack of transparency and standardization rendered the intelligibility of project structure minimal. Maven standardized the way in which Java projects were created and executed. In addition to providing a system by which the components of the project could be defined, it simplified the publication of project information and enabled the uncomplicated sharing of JAR files between multiple projects.

The workshop in this book has been designed in such a way that the reader should be able to work through it completely independently of the IDE they choose to use. For this reason, we will use Maven to build and deploy our Java EE application. WildFly 8.1.0 will be used as an application server because of its high practical relevance. Additionally, in Chapter 9, we will use Oracle’s Glassfish 4 to acquaint ourselves with the Java EE reference implementation. In Chapter 10 we will focus on the cloud offering OpenShift, which provides an instance of WildFly in the cloud.  The installation of Maven 3 and WildFly 8.1.0 will be described in section 2.2. We have left it to the reader to decide which IDE they wish to use. While it is even possible to follow the workshop with a simple text editor, we would obviously recommend that the reader tries to integrate their Maven project in the IDE of their choice. This approach affords the greatest possible flexibility. A few pointers regarding the integration of Maven projects in Eclipse will be given in section 2.4.