Changing the Version of the JDK Your Project Is Based On


By default, IDE projects use the same JDK that the IDE runs on. To set up a project to run on a different JDK, you need to:

  1. Add the JDK in the Java Platform Manager.

  2. Specify the JDK for the project to use in the project's Project Properties dialog box.

By default, the IDE includes only the version of the JDK that the IDE is running on in the Java Platform Manager.

To make another JDK version available for projects in the IDE:

  1. Choose Tools | Java Platform Manager.

  2. Click Add Platform.

  3. In the file chooser, navigate to and select the JDK version you want to add to the Java Platform Manager.

    The JDK folder should be marked with the icon in the file chooser.

  4. Close the Java Platform Manager.

To switch the JDK that a project uses:

  1. Right-click the project's main node in the Projects window and choose Properties.

  2. Select the Libraries node.

  3. Select the JDK that you want to use in the Java Platform combo box.

  4. If the version of the JDK that you want does not appear in the list, click Manage Platforms to open the Java Platform Manager and click Add Platform to add a JDK to the list of those recognized by the IDE.

If you want to change the JDK that the IDE itself runs on, you can do so in the netbeans.conf file in the IDE's installation directory. In a file manager on your system, navigate to the IDE's installation directory, expand NetBeansHome/etc, and open netbeans.conf in a text editor. Below the #netbeans_jdkhome="/path/to/jdk" comment line, type the netbeans_jdkhome option with the path to the JDK.

For example:

netbeans_jdkhome="C:/j2sdk1.4.2_12"


The Default choice, which appears anywhere that you can specify the Java platform, then is changed to refer to the JDK you have specified.




NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 279

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net