First, I installed OpenCV on Ubuntu using sudo apt-get install libcv-dev
Then, I put the openCV wrapper files known as "Processing OpenCV Library" from (this is the version that worked on my installation):
in a dir1 and then added to my JVM options java extensions directory as specified on the Processing page: -Djava.ext.dirs=dir1
For the Face Detection to work, I had to set the cascade using OpenCV::cascade function before the OpenCV::detect call. After this, the example FaceDetection.java worked for me.
Sometime soon I needed the class file for PImage at run time. For this, I downloaded Processing from http://processing.org/download/processing-1.1.tgz. Then I put the directory containing core.jar (dir2) also in the java extensions setting above. That is,