I had the same problem and none of the solutions posted solved (i already had primefaces jar in my classpath).
I use a eclipse project format, and in the .settings folder, the file "org.eclipse.wst.common.project.facet.core.xml" had this properties:
<installed facet="jst.jsf" version="1.2"/>
<installed facet="jst.web" version="2.5"/>
I changed to:
<installed facet="jst.jsf" version="2.0"/>
<installed facet="jst.web" version="3.0"/>
And it worked. Sure it was a wrong configuration, but can be useful to someone.
Ps: these properties can be changed in project facets on eclipse project properties, but in some cases it´s better change directly in the file.