How do I change the JDK home for Netbeans?

I recently upgraded my JDK and I started getting this message when I launched Netbeans.

Cannot locate java installation in specified jdkhome: [some outdated path].  Do you want to try to use default version?

I’m capable of ignoring messages like this for months, but when I tried to start a new Maven web application, it balked.  It’s simple enough to fix, but it wasn’t obvious to me.  So here you go.

Step One

In your Netbeans home directory (for example, C:\Program Files\NetBeans 7.0.1), open up the netbeans.conf in the etc directory (C:\Program Files\NetBeans 7.0.1\etc\netbeans.conf).

Step Two

Theres a property called netbeans_jdkhome.  Change the value to match the JDK you want Netbeans to use (for example, C:\Program Files\Java\jdk1.6.0_25).

Step Three

Save your changes

Step Four

Restart Netbeans

Thanks for reading!  If you would like to see what else I’m up to, check out Whiff


  1. I’m facing the same Problem.
    When I change the path. It shows access denied.
    What do I do, I’m using an administrative user account.

  2. NetBeans 8.2 – Cannot locate java installation in specified jdkhome?
    Answer: Edit the netbeans.conf file.
    Close NetBeans, start Notepad or another text editor as Administrator. Right click on the Notepad application and choose “Run as administrator” and then open netbeans.conf with it. Change netbeans_jdkhome=”C:\Program Files\…whatever”.

  3. You got me with the first sentence “I’m capable of ignoring messages like this for months” 😀
    So… I just want to do it the right way after month now, thank you 😉

  4. My NetBeans can’t open any project after this changes 😦
    What’s the problem here?
    I program on C :B

  5. I followed the instructions but still got the error. However, when I clicked “Yes” to use the default version NetBeans started up fine. Using NetBeans IDE 9, JDK 11.0.1, Win10 Home.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s