I recently came across this message when opening NetBeans after updating my Java version from 1.7.0_05 to 1.7.0_07.
Cannot locate Java installation in specified jdkhome: C:\Program Files\Java\jdk1.7.0_05 Do you want to try to use default version?
There are no ill effects from clicking Yes, and everything works as normal within NetBeans, but it’s annoying having to click Yes each time you open NetBeans right?
I tried every menu I could find within NetBeans, but was unable to make the message go away. Thankfully, you can fix this message by editing a config file in the NetBeans installation directory located at /etc/netbeans.conf. For me this was:
C:\Program Files\NetBeans 7.2\etc\netbeans.conf
The line you are looking for is:
Which was on line 57 for me.
Simply change this to your current Java version and you should no longer see that annoying message!
Update August 2015:
In the comments, Andrew has recommended that it’s possible to comment the above line out (put a # at the start) and the launcher will automatically detect and use a JDK, which will work for NetBeans 8 with Java 8 and beyond.
This post is part of our “NetBeans article Index” series. In these articles, we aim to explore NetBeans in different ways, from useful hint and tips, to our how-to’s, experiences and usage of the NetBeans IDE.