Document Information


1.  Introduction

Goals of This Tutorial

2.  The Java Platform, Enterprise Edition

3.  Creating Your First Java EE Application

4.  Building, Packaging, and Deploying and Running the Example Application

5.  Next Steps


Requirements for This Tutorial

A Checklist

To complete this tutorial, you need to:

  • Get the tutorial bundle

  • Get the Java EE 5 Software Development Kit

  • Get NetBeans IDE (optional)

  • Configure your environment

Getting the Tutorial Bundle

To get the tutorial bundle, go to the project's site.

Getting the Java EE 5 SDK

To get the Java EE 5 SDK, go to

Getting NetBeans 5.5

To get NetBeans 5.5 go to

Configuring Your Environment

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

Building the Examples Using NetBeans IDE

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

  1. Select Tools→Server Manager to open the Server Manager dialog.

  2. Click Add Server.

  3. Under Server, select Sun Java System Application Server and click Next.

  4. Under Platform Location, enter the location of your Application Server installation.

  5. Select Register Local Default Domain and click Next.

  6. Under Admin Username and Admin Password, enter the admin name and password created when you installed the Application Server.

  7. Click Finish.

Building the Examples on the Command-Line Using Ant

Build properties common to all the examples are specified in the file in the tut-install/example/bp-project/ directory. You must create this file before you can run the examples. Copy the file to and edit it to reflect your environment. The tutorial examples use the Java BluePrints build system and application layout structure.

To run the Ant scripts, you must set common build properties in the file tut-install/example/bp-project/ as follows:

  • Set the javaee.home property to the location of your Application Server installation. The build process uses the javaee.home property to include the libraries in as-install/lib/ in the classpath. All examples that run on the Application Server include the Java EE library archive, as-install/lib/javaee.jar. in the build classpath. Some examples use additional libraries in as-install/lib/; the required libraries are enumerated in the individual technology chapters.

    Note - On Windows, you must escape any backslashes in the javaee.home property with another backslash or use forward slashes as a path separator. So, if your Application Server installation is C:\Sun\AppServer, you must set javaee.home to javaee.home = C:\\Sun\\AppServer or javaee.home=C:/Sun/AppServer.

  • Set the firstcup.tutorial.home property to the location of your tutorial. This property is used for Ant deployment and undeployment.

    For example, on UNIX:


    On Windows:


    Do not install the tutorial to a location with spaces in the path.

  • If you did not accept the default values for the admin user and password, set the admin.user property to the value you specified when you installed the Application Server, and set the admin user’s password in the admin-password.txt file in the tut-install/example/bp-project/ directory to the value you specified when you installed the Application Server.

  • If you did not use port 8080, set the javaee.server.port property to the value specified when you installed the Application Server.