Let's start from step 1... how did you install OpenJDK on your system? Did you perform a manual installation, or did you rely on the Ubuntu Software Manager?

Second, which version of Netbeans are you attempting to use? I just download version 8.0 onto my Kubuntu 14.04 system, and it automatically detects the latest version of the JDK I have installed on my system.

Note: For professional reasons, I am obliged to use Oracle (previously Sun) JDKs for Java development, hence I have these installed on my system. I do not use OpenJDK.