February 1, 2009

Add Google Data Java Client library to NetBeans

The Google Data API is available as Java client library. With this library we can invoke Google Data services via simple Java calls. To add the Google Data Java Client libary to NetBeans we must first download the latest library from the Google Data API site. We must unpack the ZIP file to a directory on our local computer.

In NetBeans we go to Tools | Libraries to create a new Class library. We must click on the New Library... button and Netbeans open a dialog window. In this window we type in the name of our library: GoogleDataJavaAPI and leave the Library Type to Class Libraries.

We click the OK button and NetBeans closes the dialog window. Now we can set the Classpath for the library. This must contain all the JAR files belonging to the Google Data Java Client. So we click on the Add JAR/Folder... and browse to the directory where we unzipped the Google Data Java Client zip file. We open the lib folder and select all files:

To complete the library definition we can also add the Sources and Javadoc so we can get the most information in the Java editor: