How to setup a Java Facebook Application

Posted by Brian Porter on December 07, 2010

First I discovered that there was an open source, Java based, Facebook Application which includes samples of the following:

  • Activity Feed
  • Like Button
  • Recommendations
  • Comments
  • Facepile
  • Live Stream
  • Graph API
  • OAuth v2

Activity FeedLike ButtonRecommendationsCommentsFacepileLive StreamGraph APIOAuth v2

It is located at: http://code.google.com/p/facebook-java-webapp

So I followed the instructions, and checked it out with SVN into a local directory:

svn checkout http://facebook-java-webapp.googlecode.com/svn/springwebmvc-hibernate/trunk/ facebook-java-webapp-read-only

Then I edited the property file as described, to point to the local mysql database I setup with a user “facebook” and a database “facebook”.

emacs src/main/resources/facebook.properties

Then I followd the instructions for setting up the database:

http://code.google.com/p/facebook-java-webapp/#Create_Database

mvn -Pdb clean

I then setup the project:

mvn -Phibernate process-resources

And finally ran it:

mvn tomcat:run

If you made it this far, you may as well follow me on LinkedIn: Follow Brian Porter