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

Advertisements

13 thoughts on “How do I change the JDK home for Netbeans?

  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”.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s