Why do I like coding in Netbeans IDE? I don't really know why, I just do. Don't get me wrong, I use Eclipse and it is a great tool but Netbeans and me go way back. But unfortunately there is a little hiccup with the latest Netbeans 7.0. Installing Netbeans while having OpenJDK results in Netbeans refusing to start with error message
"Cannot find java. Please use the --jdkhome switch" when you try to start it with Sun (now Oracle) Java. The fix for this annoying bug (I guess we can call it bug) is rather trivial so read on.
"netbeans.conf" is the patient we will operate on. You can find this file inside
"/usr/local/netbeans-7.0/etc/" directory (depending on where you have installed Netbeans). So lets open it like this:
gksudo gedit /usr/local/netbeans-7.0/etc/netbeans.conf
Now find the
"netbeans_jdkhome" option and make it look like this:
# Default location of JDK, can be overridden by using --jdkhome <dir>: netbeans_jdkhome="/usr/lib/jvm/java-6-sun"
All that's left is to have fun coding using Netbeans with your favorite programming language.