How to set the JDK Netbeans runs on?

Frank picture Frank · Aug 5, 2011 · Viewed 288.8k times · Source

I have older NB6.7, NB6.9, NB7.0, which used to run on jdk1.6.0_21 and jdk1.6.0_25. Now I've removed those JDKs and only have jdk1.6.0_26 and jdk1.7.0 left, but I still want to keep the older NBs, but now when I run them, I get this message:

"Cannot locate java installation in specified jdkhome C:\Program Files (x86)\Java\jdk1.6.0_25 Do you want to try to use default version ?"

I tried to find where it's looking for the "jdk1.6.0_25", and updated a few config files in "C:\Program Files (x86)\NetBeans 6.7" and "C:\Users\USER.nbi\registry.xml", and yet the message keeps coming, my question is, where and what do I need to change to point it to: C:\Program Files (x86)\Java\jdk1.6.0_26?

Answer

Frank picture Frank · Aug 5, 2011

Thanks to KasunBG's tip, I found the solution in the "suggested" link, update the following file (replace 7.x with your Netbeans version) :

C:\Program Files\NetBeans 7.x\etc\netbeans.conf

Change the following line to point it where your java installation is :

netbeans_jdkhome="C:\Program Files\Java\jdk1.7xxxxx"

You may need Administrator privileges to edit netbeans.conf