# LAB-5542: Project Jersey: Building RESTful Web Services in Java

Expected Duration: 120 minutes
Contacts: Martin Matula, Srinivas Bhimisetty

Introduction | Exercise 0 | Exercise 1 | Exercise 2 | Exercise 3 | Summary
### Exercise 0: Install and Configure Lab Environment In addition to the contents of this lab's zip file you should have the following installed on your computer: Java SE Development Kit, version 1.5.0_11 or 1.6.0 or more recent. Most likely it is already installed on your machine. If not, you can get it from here. Make sure JAVA_HOME environment variable points to the root of the Java installation. Maven 2.0.9 or a more recent stable release. See Maven Download for detailed instructions. NetBeans 6.5 or 6.5.1, either the "Java" or the "All" bundle from http://www.netbeans.org/downloads/index.html. These bundles include GlassFish v2(.1), so there is no need to install GlassFish separately. Firefox 3 web browser - can be downloaded from www.firefox.com. After installing Firefox we need to install the Poster add-on, which will enable us to send any kind of HTTP requests to our RESTful service and see the raw responses. If Firefox is not already running, start it. When Firefox has started, select Tools->Add-ons from the main menu. In the Add-ons dialog enter "Poster" into the search field and hit Enter. Poster should appear as the first add-on in the list. Click Add to Firefox. In the next dialog click Install Now. After the installation is complete, restart Firefox to complete the changes. If the Add-on dialog pops up after the restart, close it. You should see the Poster icon in the Firefox statusbar. We also need to install the Maven plugin into the NetBeans IDE. Here is how to do this: If NetBeans is not already running, start it. When NetBeans has started, select Tools->Plugins and select "Maven" in the Available Plugins tab. Click the Install button. In the following dialog accept the license and click Install. After the installation completed, click Finish and close the Plugins dialog. To make sure the Maven NetBeans plugin is using the right version of Maven: In NetBeans select Tools->Options (on Mac OS select NetBeans ->Preferences) and switch to Miscellaneous->Maven tab. Set the patch to your Maven installation in External Maven Home field. And we need to ensure that GlassFish v2 is registered as a server in NetBeans: In NetBeans click on the Services tab. Now expand the Servers node in the Services tab (if possible). If you don't see GlassFish v2 under that node, right-click it and choose Add Server. In the Add Server Instance dialog that will pop up, select GlassFish V2 and click Next. In the next dialog screen set the Platform Location to your GlassFish installation directory. Once you do it, Register Local Default Domain should be selected automatically. Click Finish. Back to top Next exercise