The Java EE 6 Tutorial, Volume I

ProcedureBuilding and Deploying the simplegreeting Example Using NetBeans IDE

Follow these instructions to build, package, and deploy the simplegreeting example to the Enterprise Server using NetBeans IDE.

This procedure builds the application into the tut-install/examples/cdi/simplegreeting/build/web directory and deploys the contents of this directory to the Enterprise Server.

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

  2. In the Open Project dialog, navigate to tut-install/examples/cdi/.

  3. Select the simplegreeting folder.

  4. Select the Open as Main Project checkbox.

  5. Click Open Project Folder.

  6. (Optional) To modify the Printer.java file, perform these steps:

    1. Expand the Source Packages node.

    2. Expand the greetings node.

    3. Double-click the Printer.java file.

    4. In the edit pane, comment out the @Informal annotation:

          //@Informal
          @Inject
          Greeting greeting;
    5. Save the file.

  7. In the Projects tab, right-click the simplegreeting project and select Deploy.