RESTful Web Services Developer's Guide

ProcedureRunning the Jersey Examples from NetBeans

To run the Jersey samples from NetBeans, follow these steps.

  1. If you didn't do this in the previous task, download and install Maven 2.0.9 or higher from the Apache Maven Project web site at http://maven.apache.org/download.html. Make sure to follow the instructions in the Maven README.html file which include adding the maven/bin directory to your path statement.

  2. From the NetBeans IDE, install the Maven plugin. To do this, select Tools->Plugins, select Maven, click Install, and follow the prompts.

  3. Configure Maven in NetBeans IDE. To do this, select Tools->Options, select Miscellaneous from the top panel, then select the Maven tab.

  4. For the External Maven Home field, browse to your Maven installation.

  5. If the option is available, check Always use external Maven for building projects. Close the dialog.

  6. From the NetBeans IDE, select File->Open Project, and then browse to the location of the project you'd like to open, for example, jersey/samples/helloworld.

  7. Check Open as Main Project, then click Open Project.

  8. Right-click the project and select Run.

  9. Follow the instructions from the prompt. For example, if you're running HelloWorld, enter http://localhost:9998/helloworld in a web browser.