Java Platform, Enterprise Edition (Java EE) 8 The Java EE Tutorial

## Running the Duke’s Bookstore Case Study Application

You can use either NetBeans IDE or Maven to build, package, deploy, and run the Duke’s Bookstore application.

The following topics are addressed here:

- To Build and Deploy Duke’s Bookstore Using NetBeans IDE

- To Build and Deploy Duke’s Bookstore Using Maven

- To Run Duke’s Bookstore

### To Build and Deploy Duke’s Bookstore Using NetBeans IDE

1. Make sure that GlassFish Server has been started (see Starting and Stopping GlassFish Server).

2. From the File menu, choose Open Project.

3. In the Open Project dialog box, navigate to:

       tut-install/examples/case-studies

4. Select the `dukes-bookstore` folder.

5. Click Open Project.

6. In the Projects tab, right-click the `dukes-bookstore` project and select Build.

   This will build, package, and deploy Duke’s Bookstore to GlassFish Server.

### To Build and Deploy Duke’s Bookstore Using Maven

1. Make sure that GlassFish Server has been started (see Starting and Stopping GlassFish Server), as well as the database server (see Starting and Stopping Apache Derby).

2. In a terminal window, go to:

       tut-install/examples/case-studies/dukes-bookstore/

3. Enter the following command:

       mvn install

   This command builds the application and packages it in a WAR file in the `_tut-install_/examples/case-studies/dukes-bookstore/target/` directory. It then deploys the application to GlassFish Server.

### To Run Duke’s Bookstore

1. In a web browser, enter the following URL:

       http://localhost:8080/dukes-bookstore/

2. On the Duke’s Bookstore main page, click a book in the graphic, or click one of the links at the bottom of the page.

3. Use the pages in the application to view and purchase books.

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.