Set Default JDK on Netbeans on Mac OS X
As shown here
Just to sumarize, there is a netbeans.conf file that needs to be modified. You can Ctrl-Click on the netbean app file to access the directory behind it from Finder. Also, I just set it to the current JDK as follows:
netbeans_jdkhome=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
so that it always uses the most recent JDK.