The Java EE 7 Tutorial

Previous
Next

2.1 Required Software

The following software is required to run the examples:

2.1.1 Java Platform, Standard Edition

To build, deploy, and run the examples, you need a copy of the Java Platform, Standard Edition 7 Development Kit (JDK 7). Some distributions of the Java EE 7 SDK include JDK 7. You can download JDK 7 software separately from http://www.oracle.com/technetwork/java/javase/downloads/index.html.

2.1.2 Java EE 7 Software Development Kit

GlassFish Server Open Source Edition 4 is targeted as the build and runtime environment for the tutorial examples. To build, deploy, and run the examples, you need a copy of GlassFish Server and, optionally, NetBeans IDE. To obtain GlassFish Server, you must install the Java EE 7 Software Development Kit (SDK), which you can download from http://www.oracle.com/technetwork/java/javaee/downloads/index.html. Make sure that you download the Java EE 7 SDK, not the Java EE 7 Web Profile SDK. There are distributions of the Java EE 7 SDK with and without the Java Platform, Standard Edition 7 Development Kit.

2.1.2.1 SDK Installation Tips

Do the following during the installation of the SDK.

  • Allow the installer to download and configure the Update Tool. If you access the Internet through a firewall, provide the proxy host and port.

  • Configure the GlassFish Server administration user name as admin, and specify no password. This is the default setting.

  • Accept the default port values for the Admin Port (4848) and the HTTP Port (8080).

  • Do not select the check box to create an operating system service for the domain.

You can leave the check box to start the domain after creation selected if you wish, but this is not required.

This tutorial refers to as-install-parent, the directory where you install GlassFish Server. For example, the default installation directory on Microsoft Windows is C:\glassfish4, so as-install-parent is C:\glassfish4. GlassFish Server itself is installed in as-install, the glassfish directory under as-install-parent. So on Microsoft Windows, as-install is C:\glassfish4\glassfish.

After you install GlassFish Server, add the following directories to your PATH to avoid having to specify the full path when you use commands:

as-install-parent/bin
as-install/bin

2.1.3 Java EE 7 Tutorial Component

The tutorial example source is contained in the tutorial component. To obtain the tutorial component, use the Update Tool.

2.1.3.1 To Obtain the Tutorial Component Using the Update Tool

  1. Start the Update Tool by performing one of the following actions.

    • From the command line, enter the command updatetool.

    • On a Windows system, from the Start menu, choose All Programs, then choose Java EE 7 SDK, then choose Start Update Tool.

  2. Expand the Java EE 7 SDK node.

  3. Select Available Updates.

  4. From the list, select the Java EE 7 Tutorial check box.

  5. Click Install.

  6. Accept the license agreement.

    After installation, the Java EE 7 Tutorial appears in the list of installed components. The tool is installed in the as-install-parent/docs/javaee-tutorial directory, which is referred to throughout the tutorial as tut-install. This directory contains two subdirectories: docs and examples. The examples directory contains subdirectories for each of the technologies discussed in the tutorial.

Next Steps

Updates to the Java EE 7 Tutorial are published periodically. For details on obtaining these updates, see Getting the Latest Updates to the Tutorial.

2.1.4 NetBeans IDE

The NetBeans integrated development environment (IDE) is a free, open-source IDE for developing Java applications, including enterprise applications. NetBeans IDE supports the Java EE platform. You can build, package, deploy, and run the tutorial examples from within NetBeans IDE.

To run the tutorial examples, you need the latest version of NetBeans IDE. You can download NetBeans IDE from https://www.netbeans.org/downloads/index.html. Make sure that you download the Java EE bundle.

2.1.4.1 To Install NetBeans IDE without GlassFish Server

When you install NetBeans IDE, do not install the version of GlassFish Server that comes with NetBeans IDE. To skip the installation of GlassFish Server, follow these steps.

  1. On the first page of the NetBeans IDE Installer wizard, deselect the check box for GlassFish Server and click OK.

  2. Accept both the License Agreement and the Junit License Agreement.

    A few of the tutorial examples use the Junit library, so you should install it.

  3. Continue with the installation of NetBeans IDE.

2.1.4.2 To Add GlassFish Server as a Server Using NetBeans IDE

To run the tutorial examples in NetBeans IDE, you must add your GlassFish Server as a server in NetBeans IDE. Follow these instructions to add GlassFish Server to NetBeans IDE.

  1. From the Tools menu, choose Servers.

  2. In the Servers wizard, click Add Server.

  3. Under Choose Server, select GlassFish Server and click Next.

  4. Under Server Location, browse to the location of the Java EE 7 SDK and click Next.

  5. Under Domain Location, select Register Local Domain.

  6. Click Finish.

2.1.5 Apache Maven

Maven is a Java technology–based build tool developed by the Apache Software Foundation and is used to build, package, and deploy the tutorial examples. To run the tutorial examples from the command line, you need Maven 3.0 or higher. If you do not already have Maven, you can install it from:

http://maven.apache.org

Be sure to add the maven-install/bin directory to your path.

If you are using NetBeans IDE to build and run the examples, it includes a copy of Maven.

Previous
Next