Your First Cup: An Introduction to the Java EE Platform

A Checklist

To complete this tutorial, you need to:

For up-to-the-minute information on which versions of the required software are compatible with this tutorial see the First Cup 2.0 compatibility page.

Getting the Java EE 6 SDK

To get the Java EE 6 SDK, go to http://java.sun.com/javaee/downloads/index.jsp.


Note –

This tutorial requires Sun GlassFish Enterprise Server v3 Classic profile, included in the Java EE 6 SDK Preview. Using this tutorial with the Java EE 6 SDK Preview Web Profile requires the included Enterprise Server v3 to be updated, as described Add JAX-RS Support to the Java EE SDK Web Profile.


Getting NetBeans 6.7 IDE

To get NetBeans 6.7 IDE go to http://www.netbeans.org/downloads/index.html.

Configuring Your Environment

Once you have all the necessary downloads, you must configure the tutorial bundle to reflect your environment.

ProcedureEnabling Enterprise Server v3 Support in NetBeans 6.7 IDE

NetBeans 6.7 IDE must be configured to support Sun GlassFish Enterprise Server v3.

  1. In NetBeans 6.7 IDE select Tools -> Plugins.

  2. In the Available Plugins tab select GlassFish v3 Enabler and click Install.

  3. Click Next.

  4. Check the License Agreement accept box and click Install.

  5. After the plugins are installed, click Finish.

  6. Restart NetBeans 6.7 IDE.

ProcedureAdding Enterprise Server v3 as a Server in NetBeans 6.7 IDE

To run the tutorial examples in NetBeans 6.7 IDE, you must register your Enterprise Server v3 installation as a NetBeans Server Instance. Follow these instructions to register the Enterprise Server v3 in NetBeans 6.7 IDE.

Before You Begin

Enable Enterprise Server v3 support as described in Enabling Enterprise Server v3 Support in NetBeans 6.7 IDE.

  1. Select Tools -> Server Manager to open the Servers dialog.

  2. Click Add Server.

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

  4. Under Platform Location, browse to or enter the location of your Enterprise Server v3 installation.

  5. Click Next.

  6. Under Domain, use the drop-down list to select an existing domain, type in the path to the domain directly in the field, or type the name of a new domain to create.

  7. Click Finish.

ProcedureInstalling the Facelets NetBeans 6.7 IDE Plugins

Install the Facelets plugins to enable the JavaServer Faces Facelets application framework support in NetBeans 6.7 IDE.

  1. Select Tools->Plugins in NetBeans 6.7 IDE.

  2. Click the Available Plugins tab, select Facelets Support, and click Install.

  3. Click Next.

  4. Check the License Agreement accept box and click Install.

  5. After the plugins are installed, click Finish, then Close.

ProcedureAdd JAX-RS Support to the Java EE SDK Web Profile

If you are using the Java EE 6 SDK Web Profile, it does not support JAX-RS by default. Add JAX-RS support through the Update Center.

  1. In NetBeans 6.7 IDE right-click the Enterprise Server v3 instance in the Services tab and select View Update Center.

    The Update Tool interface is displayed.

  2. In the navigation tree, expand Sun GlassFish Enterprise Server v3 and select Available Add-ons.

  3. Select Jersey RESTful Web Services for GlassFish and click Install.

  4. Click Accept to accept the terms of the license agreement.

Getting the Latest Updates to the Tutorial

Check for any updates to the tutorial by using the Update Center included with the Java EE 6 SDK.

ProcedureUpdating the Tutorial Through the Update Center

Open the Update Center and check for any updates to the tutorial.

  1. Open the Services tab in NetBeans 6.7 IDE and expand Servers.

  2. Right-click the GlassFish v3 instance and select View Update Center to display the Update Tool.

  3. Select Available Updates in the tree to display a list of updated packages.

  4. Look for updates to the First Cup 2. 0 for Java EE 6 (javaee-firstcup-tutorial) package.

  5. If there is an updated version of First Cup 2.0, select First Cup 2. 0 for Java EE 6 (javaee-firstcup-tutorial) and click Install.