Ok got it.
When you run netbeans, the shell script gets run - runide.sh, which would be under NetBeans3.6/bin/runide.sh. When you run that, and gives you that error, you must add --jdkhome /path/to/java/directory after it like so
Code:
$ sh runide.sh --jdkhome /the/path/to/your/java/directory
My path, for example, would be /usr/java/jdk1.5.0_01 The folder /usr/java/ is where java is installed by default, but when you install netbeans, it installs the java stuff too. If you installed netbeans as root, then you had a chance to install it in /usr/java, but if not, then it might be in your home directory somewhere.