I had a similar problem after updating Netbeans recently.
I was able to get it working by re-adding Java 1.7 in the platforms configuration of NetBeans.
I'm using NetBeans 7.4.
(Right click on project) > Properties > Libraries Category > Manage Platforms Button Add Platform pointing to Java 1.7 or 1.6 JDK as desired. Select new Platform in Properties window and select "ok".
Hope this helps someone.