OpenCV provides haar like feature detection algorithm which can be used for object detection. Wikipedia page http://en.wikipedia.org/wiki/Haar-like_features provides nice information about what are haar like feature.
OpenCV also provides haar training utility which can be used for training. It generates XML file from training samples which further can be used for fast object detection. Such XML file is provided with opencv package for face detection.
Gist below explains how to use haar classifier in JavaCV. Code loads classifier file haarcascade_frontalface_default.xml and uses cvHaarDetectObjects() to find faces in loaded image. More information about cvHaarDetectObjects() can be found at http://opencv.willowgarage.com/documentation/object_detection.html#haardetectobjects
Result of this code generates window which shows loaded picture and red rectangle around detected faces.
You can fork complete eclipse project at https://github.com/nikhil9/FaceDetection/