Can I specify the JDK to run NetBeans on?

Yes, use the --jdkhome <path> option when starting NetBeans. <path> is the root of the JDK installation.

The NetBeans installer looks for suitable JDK installations available on user's system and allows the user to select the one she wants to run NetBeans with. For the installer (6.0-M10) itself use --javahome <path>. However, the setting may become obsolete when the user installs a new JDK later, or may be inconvenient when you want to run the IDE with another JDK. That's where the --jdkhome swich comes handy.

If you want to set the option permanently, you can do so in the netbeans.conf file.


  • Windows
netbeans.exe --jdkhome "C:\Program Files\jdk1.6.0_20"
  • Unix
netbeans --jdkhome /usr/bin/jdk1.6.0_20

Applies to: NetBeans 3.6, 4.x, 5.x, 6.x, 7.x, 8.x

Platforms: All

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo