Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I uninstalled JDK 1.6.26, then installed JDK 7 and changed my PATH to point to the new version.

However when I now open NetBeans it shows me this error:

enter image description here

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

How can I make JDK 7 the default JDK that NetBeans uses?

share|improve this question
The error message complains about 1.6.25 but you uninstalled 1.6.26 I am going to guess you forgot to do something. Uninstall ALL versions of java and reinstall 1.7 – Ramhound Sep 14 '11 at 15:00
i did this exactly – Milad Sobhkhiz Oct 27 '11 at 9:04
up vote 6 down vote accepted

Locate netbeans.conf and change the following according to your JDK location:

"netbeans_jdkhome="C:\Program Files\Java\jdk1.7.0_01""

It will solve your problem.

The file may not have writing permission for a regular user so make sure to give yourself permission to write the file if you are unable to save the changes.

share|improve this answer
thanks, i found it, and after editing it my problem has been resolved! – Milad Sobhkhiz Feb 15 '12 at 6:02

First, try checking your other environment variables for references to the old path. Specifically, check JAVA_HOME and JRE_HOME.

I don't know about NetBeans, but Eclipse tends to remember the JDK location in an internal setting. You may need to reset the path in the NetBeans preferences.

Finally, try searching your registry for references to the old JDK path.

share|improve this answer
i check Path and edit it for new version – Milad Sobhkhiz Sep 16 '11 at 9:18
but where is JAVA_HOME and JRE_HOME – Milad Sobhkhiz Sep 16 '11 at 9:18
That depends on the OS you are using. Google "setting JAVA_HOME windows XP" for example. – Chris Nava Sep 21 '11 at 4:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .