
Deploying our first application
NetBeans comes pre-configured with a number of sample applications. To make sure everything is configured correctly, we will now deploy one of the sample applications to the integrated GlassFish application server that comes bundled with NetBeans.
To open the sample project, we need to go to File | New Project, then select Samples | Java EE from the Categories list in the resulting pop-up window. Once we have selected Java EE from the categories list, a list of projects is displayed in the Projects list; for this example we need to select the JavaServer Faces CDI project. This sample is a simple project involving both JSF and Contexts and Dependency Injection (CDI).

After clicking on the Next> button, we are prompted to enter a project location in the next pop-up window. In this case, the default value is sensible.

Once we click on the Finish button, our new project is displayed in the Projects window:

We can compile, package, and deploy our project at one go by right-clicking on it and selecting Run from the resulting pop-up menu.

At this point, we should see the output of the build script. Also, both the integrated GlassFish application server and the integrated JavaDB RDBMS system should automatically start.

As soon as our application is deployed, a new browser window or tab automatically starts, displaying the default page for our sample application.

If our browser is displaying a page similar to the preceding one shown, then we can be certain that NetBeans and GlassFish are working properly and we are ready to start developing our own Java EE applications.