The Java EE 6 Tutorial

Building, Packaging, Deploying, and Running the order Application

This section explains how to build, package, deploy, and run the order application. To do this, you will create the database tables in the Java DB server, then build, deploy, and run the example.

ProcedureTo Build, Package, Deploy, and Run order UsingNetBeans IDE

  1. In NetBeans IDE, select File->Open Project.

  2. In the Open Project dialog, navigate to:


    tut-install/examples/persistence/
    
  3. Select the order folder.

  4. Select the Open as Main Project check box.

  5. Click Open Project.

  6. In the Projects tab, right-click the order project and select Run.

    NetBeans IDE opens a web browser to http://localhost:8080/order/.

ProcedureTo Build, Package, Deploy, and Run order Using Ant

  1. In a terminal window, go to:


    tut-install/examples/persistence/order/
  2. Type the following command:


    ant
    

    This runs the default task, which compiles the source files and packages the application into a WAR file located at tut-install/examples/persistence/order/dist/order.war.

  3. To deploy the WAR, make sure that the GlassFish Server is started, then type the following command:


    ant deploy
    
  4. Open a web browser to http://localhost:8080/order/ to create and update the order data.

The all Task

As a convenience, the all task will build, package, deploy, and run the application. To do this, type the following command:


ant all