Cloud9: Adding to your own project

by Jimmy Lin

Once you've gotten Cloud9 running from this guide. You'll probably want to add the libraries to your own project (since it would be unwise to develop directly in the Cloud9 repository).

This is a bit tricky because Cloud9 isn't installed on the Hadoop cluster, so you'll need to ship over the the library itself. Unfortunately, the Hadoop Eclipse plug-in isn't smart enough to package necessary dependencies along with your code, so simply including the Cloud9 jar in the build path won't work (it'll allow you to compile the program locally, but the program will fail to run on the server).

We get around this by using the "Link Source" feature in Eclipse, which is like a symbolic link. Here's what you do: right click on the project you want to use Cloud9 in, select "Properties". Go to "Java Build Path", go to "Source" tab, click "Link Source..." button. Specify a folder name ("cloud9") and browse for the location of umd-hadoop-core/src. After you've done this, the linked source folder should appear in your project, annotated with a little icon.

One issue with this solution is that the linked source folder path must be an absolute path. This information is stored in the .project metadata file in your project directory. Thus, if your project is under version control, there may be a problem since everyone's sandbox might not be in the same location. Therefore, if other people check out the same project they must fix the path in their sandbox. Not ideal, but I haven't found a better solution...

Back to main page

This page, first created: 31 Jan 2008; last updated: Creative Commons: Attribution-Noncommercial-Share Alike 3.0 United States Valid XHTML 1.0! Valid CSS!