By default, the IDE uses the version of the Java SE platform (JDK) with which
the IDE runs as the default Java platform for compilation, execution, and debugging.
You can view your IDE's JDK version by choosing Help > About and clicking
the Detail tab. The JDK version is listed in the Java field.
You can run the IDE with a different JDK version by starting the IDE with
the --jdkhomejdk-home-dirswitch on the
command line or in your IDE-HOME/etc/netbeans.conf file.
For more information, see IDE
Startup Parameters.
In the IDE, you can register multiple Java platforms and attach Javadoc and
source code to each platform. For example, if you want to work with the new
features introduced in JDK 5.0, you would either run the IDE on JDK 5.0 or register
JDK 5.0 as a platform and attach the source code and Javadoc to the platform.
In , you can switch the target JDK in the Project Properties dialog box.
In , you have to set the target JDK in the Ant script itself, then specify
the source/binary format in the Project Properties dialog box.
To register a new Java platform:
Choose Tools > Java Platforms from the main window.
Click New Platform and select the directory that contains the Java platform.
Java platform directories are marked with a
in the file chooser.
Use the Sources and Javadoc tabs to attach Javadoc documentation and source
code for debugging to the platform.
Click Close.
To set the default Java platform for a standard project:
Right-click the project's root node in the Projects window and choose Properties.
In the Project Properties dialog box, select the Libraries node in the
left pane.
Choose the desired Java platform in the Java Platform combo box.
Switching the target JDK for a standard project does the following:
Offers the new target JDK's classes for code completion.
If available, displays the target JDK's source code and Javadoc documentation.
Uses the target JDK's executables (javac and java)
to compile and execute your application.
Compiles your source code against the target JDK's libraries.
If you want to register additional Java platforms with the IDE, you
can do so by clicking the Manage Platforms button. Then click the Add
Platform button and navigate to the desired platform.
To set the target Java platform for a free-form project:
In your Ant script, set the target JDK as desired in the javac,
java, and javadoc tasks.
Right-click the project's root node in the Projects window and choose Properties.
In the Sources panel, set the level of JDK you want your application to
be run on in the Source/Binary Format combo box.
When you access Javadoc or source code for JDK classes, the IDE searches
the Java platforms registered in the Java Platform Manager for a platform
with a matching version number. If no matching platform is found, the IDE's
default platform is used instead.