How to change JDK for NetBeans
- Details
- Written by Nam Ha Minh
- Last Updated on 27 March 2020   |   Print Email
In this post, I will show you the steps to change JDK for Apache NetBeans IDE. In other words, how to run NetBeans under different version of JDK.
You know, by default, NetBeans IDE sticks with the JDK it found at the time of installation, by storing the path to JDK home in a configuration file called netbeans.conf. You can find this file under NetBeans installation directory > netbeans > etc directory.
For example, if you install NetBeans on Windows, you can find this configuration file under this directory:
C:\Program Files\NetBeans-VERSION\netbeans\etc
Then open the netbeans.conf file using a text editor. Look for the line that looks like below:
netbeans_jdkhome="g:\JDK\OpenJDK\jdk-11.0.2"
Then update new value for this property, for example:
netbeans_jdkhome="C:\Program Files\Java\jdk-14"
Save the file and restart NetBeans. And you’re all set. The Apache NetBeans IDE will run under the specified JDK.
So to change JDK for NetBeans, to update the netbeans_jdkhome property in the netbeans.conf file which can be found under installation directory > netbeans > etc directory.
You can watch the visual steps in the video below:
Other NetBeans Tutorials:
- What is NetBeans? - for beginner
- How to Use NetBeans IDE from the Basics
- Java Hello World for Beginner with NetBeans IDE
- 16 NetBeans Shortcut Keys for Code Editing
- 10 NetBeans Shortcut Keys for Code Refactoring
- How to Update License Header for Java files in NetBeans
Comments
This is Abdul Basir Mohammadi
From B section of BCA Genral