How to register a global hotkey for your application in C#

How to register a global hotkey for your application in C#

Register a hotkey for your application that can be triggered even if your form is minimized and does not have focus. More »

How to download a file in C# (progressbar and download speed)

How to download a file in C# (progressbar and download speed)

Learn how to download files in C# while displaying the percentage and the download speed. More »

UDP hole punching implementation in C#

UDP hole punching implementation in C#

Learn how to implement UDP hole punching so you can make your clients life a lot easier by not forcing them to open ports on their end. More »

 

NetBeans invalid jdkhome specified fix

If you use NetBeans as an IDE then you probably came across the following error, "Cannot locate java installation in specified jdkhome".
NetBeans invalid jdkhome error

This usually happens after you uninstall the java jdk which you used to use (usually happens after you update java).

There’s is an easy way to fix this. Navigate to your NetBeans installation folder which by default should be C:\Program Files\NetBeans and look for the folder etc. Inside that folder should be a file with the name netbeans.conf. What you need to do is to open the file with your favorite text reader (notepad as an example) and look for the line that starts with netbeans_jdkhome=.

You simply need to modify the line in order to point Netbeans to the the location of the java jdk version you are currently have installed. It should look something like this netbeans_jdkhome=”C:\Program Files\Java\jdk1.7.0_05″. If you are unsure what version you have installed navigate to your java’s installation folder (the default path is C:\Program Files\Java) and look for folder there.

If you are having issues editing the file because of UAC and the lack of administration rights and you are unsure on how to resolve that, read How to edit a file in Program Files. That should hopefully help you out.

Make sure to save the file after you are done editing it. Fire up NetBeans, the error should be gone.

Happy coding!

Share on FacebookTweet about this on TwitterShare on Google+Share on StumbleUponShare on LinkedInShare on RedditPin on PinterestShare on TumblrDigg thisPrint this pageEmail this to someone

21 Responses to NetBeans invalid jdkhome specified fix

  1. Stan says:

    Thank you! Helped well.

    • Kevin Rahe says:

      This method does not work on my 64-bit Windows 7 machine where NB 8.2 was originally installed with Java 1.8.0_121, but which I’ve now replaced with 1.8.0_131. netbeans64.exe still identifies 1.8.0_121 as the “java installation in specified jdkhome”, even after I’ve updated netbeans.conf to refer to release _131.

  2. Charles says:

    It’s happens also with Netbeans 8.0.2

  3. Olamagato says:

    Remove this stupid entry and problems gone…

  4. Rivage says:

    # Default location of JDK:
    # (set by installer or commented out if launcher should decide)
    #
    # It can be overridden on command line by using –jdkhome
    # Be careful when changing jdkhome.
    # There are two NetBeans launchers for Windows (32-bit and 64-bit) and
    # installer points to one of those in the NetBeans application shortcut
    # based on the Java version selected at installation time.
    #

  5. Saranya says:

    thanks a lot

  6. cathyhill says:

    Paul, thanks.

  7. Paul says:

    Another option is to comment out the line starting with “netbeans_jdkhome = “. That will force the launcher to choose from the installed JDKs and it should choose the most recent one. Commenting out the line frees you from having to edit netbeans.conf each time the JDK is updated (and the old JDK removed).

  8. Stephen Francis says:

    Thanks a lot

  9. Saranya says:

    Thanks. Its really Help me lot.

  10. John says:

    Thanks very much, this is exactly the information I was looking for! As someone else mentioned, you may want to update the instructions to mention to run notepad/wordpad as administrator if you’re using windows 7, however.

    • CooLMinE says:

      Thanks for the recommendation John.

      I’ve published a small post that will hopefully help people that are facing these kind of issues and updated this post to include it.

  11. JavAnton says:

    That worked like a charm, thank you.

  12. MwQ60CjJ says:

    I like this site so much, saved to favorites.

  13. Taher Giyori says:

    Thanks!!!

  14. CooLMinE says:

    You need to have administrator rights in order to edit the file. Run your text software as administrator. Assuming it’s notepad under Windows 7 here’s an idea of what you need to do. Click Start > All Programs > Accessories , right-click Notepad , and click Run as administrator, then simply open netbeans.conf, modify it and hit save.

  15. sotos says:

    my access to the file is denied…and so i can’t replace the path,,what should i do?

    • Ajit Kumar Sahoo says:

      Save it with “netbeans.conf” elsewhere, then copy and replace the origina “netbeans.conf” file located inside the “C:\Program Files\NetBeans-19\netbeans\etc”.

  16. Lisa Gurnsey says:

    I just want to say I’m beginner to weblog and certainly savored your page. More than likely I’m planning to bookmark your blog . You absolutely come with superb well written articles. Thanks for revealing your website.

  17. Bechtold says:

    Thank you for another informative site. The place else could I get that type of information written in such a perfect means? I’ve a project that I’m simply now running on, and I’ve been at the glance out for such information.

Leave a Reply

Your email address will not be published. Required fields are marked *