Netbeans Error: Invalid jdkhome specified, Cannot locate java installation in specified jdkhome

A few years ago a friend told me about Netbeans, the freebie Java-based code editor that is designed to work with Java, PHP and a range of other languages. At that point it was time to retire Homesite, my favorite editor for over 10 years that was no longer sold or supported, and was showing signs of incompatibility issues with Windows updates.

Netbeans error: Invalid jdkhome specified I have since found Netbeans to a great editor, with all of the advanced features found in Homesite and other good code editors. Recently, I was a bit surprised to see the error message, “Cannot locate java installation in specified jdkhome” pop up when I tried to start Netbeans after a recent Java update. When you see this error, you can click the Yes button and Netbeans will work as it did before the update, but the error message is a bit of a nuisance because you have to click the button each time Netbeans is started.

The root of the problem is that when a new version of Java was installed during the Java update, the old version was deleted and the new version placed in a different directory. That may have been done intentionally to defeat viruses that were looking for Java in old directory location. The remedy for the error message is to edit the netbeans.conf configuration file found in the C:\Program Files\NetBeans 7.1.2\etc directory. Your version of Netbeans may may have a different version number in the path, or the path could be different depending upon the Netbeans version and when it was installed. The important part is that you need to find the netbeans.conf file.

Look for the line that reads:

netbeans_jdkhome=”C:\Program Files\Java\jre6″

and change it to:

netbeans_jdkhome=”C:\Program Files\Java\jre7″

Note that the name of the java directory was changed from jre6 to jre7. Make sure that you use a pure text editor, such as Notepad, to make the changes. Never use a word processor to edit configuration files because word processors sometimes embed codes in the configuration file.

You can avoid the error entirely by refusing to do the Java update for your PC, but given the severity of the recently discovered Java vulnerabilities, it would be much wiser to keep Java updated if you need Java to run applications on your personal computer.

If you have not tried using Netbeans and are looking for a new code editor with advanced features, it may be worthwhile to give Netbeans a spin. It does work well and the best part is the price.