Netbeans is an IDE developed in Java and JDK. JDK installation is required to run Netbeans.

By default, NetBeans comes with the default JDK version.

Sometimes, You want to change the default Java version.

This post covers how to change the Java version in the NetBeans platform.

Netbeans change platform java version

There are multiple ways to change the JDK version.

  • using NetBeans configuration

Netbeans installation comes with netbeans.conf file with default settings.

This file is located in installation-folder/etc/netbeans.conf.

  • Open the file in a text editor and change the netbeans_jdkhome value to the JDK path as given below.
netbeans_jdkhome="A:\Java\jdk-18.0.1.1"

These changes are permanent and persistent for multiple restarts of the NetBeans platform.

  • once you made changes, please restart the server to reload the changes.

  • using the command line

Another way using the command line parameter --jdkhome <dir>

nebeans.eec --jdkhome  A:\Java\jdk-18.0.1.1

This overrides the JDK path configured in netbeans.conf.

  • Use UI Tools

This is another way to change the JDK version in IDE.

  • Open Netbeans IDE

  • Go to the Tools menu

  • Select the Java platform option

  • It opens the popup window

  • Click the Add Platform button, It opens the “Add Java Platform” window

    you can choose one of the platform types as given below

    • Java Standard Edition
    • Remote Java Standard Edition
    • Download OpenJDK

and follow the next steps to finish.