Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

up vote 5 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
1  
That depends on the OS you are using. Google "setting JAVA_HOME windows XP" for example. –  Chris Nava Sep 21 '11 at 4:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.