Thursday Feb 12, 2009

Telling NetBeans IDE Which JDK to Use

A customer has filed a bug about the Generator menu item not working for NetBeans Rails projects if the IDE is using version 6u12 of the Java Development Kit (JDK) software.

Not knowing how to tell the IDE to use a different JDK, the user reinstalled the NetBeans software.

If you don't know already, there is no need to go to such lengths. Here are two ways to tell the IDE which JDK to use.

  • Specify the JDK in the startup command. Modify the command that starts the IDE to include the --jdkhome option pointing to the desired JDK. For example:

    netbeans-install-dir/bin/netbeans.exe --jdkhome "%JAVA_HOME%"

    The above example uses the %JAVA_HOME% environment variable, which is set to C:\\Program Files\\Java\\jdk1.6.0_10, but you can just supply in the path instead. If it has spaces in it, put the path in quotes (that's why the environment variable is in quotes).

  • Specify the desired JDK in the netbeans.conf file. Open the netbeans-install-dir/etc/netbeans.conf file, look for the following option and set it to point to the desired JDK. You might need to unremark the setting.

    netbeans_jdkhome="path-to-jdk"

  • If you are not able to modify the netbeans.conf file because you are sharing the installation or you don't have permission, you can instead create an etc folder in your NetBeans userdir and put a netbeans.conf file in the etc folder. You only need to put in the options that you want to override. For more information see the How do I make my custom startup parameters permanent? FAQ.

About

divas

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today