- Downloading Apache NetBeans 17
- Community Installers
- Deployment Platforms
- Known Issues
- Building from Source
- Community Approval
- Earlier Releases
- About
- Community
- Participate
- Get Help
- Download
- Overview of JDK 8 Support in NetBeans IDE
- Enabling JDK 8 Support in NetBeans IDE
- Configuring a Project to use JDK 8
- Using Compact Profiles Support
- Using Lambda Expressions Support
- Using Repeating Annotations Support
- Downloading Apache NetBeans 18
- Community Installers
- Deployment Platforms
- Known Issues
- Building from Source
- Community Approval
- Earlier Releases
- About
- Community
- Participate
- Get Help
- Download
Downloading Apache NetBeans 17
Apache NetBeans 17 was released on February 21, 2023.
Apache NetBeans 17 is available for download from your closest Apache mirror.
Binaries (Platform Independent):
Installers and Packages:
Officially, it is important that you verify the integrity of the downloaded files using the PGP signatures (.asc file) or a hash (.sha512 files). The PGP keys used to sign this release are available here.
Release Notes:
Community Installers
- Codelerity / Gj IT packages — Windows, macOS and Linux (.deb / .rpm / .AppImage) built with NBPackage. Most include a local JDK runtime for the IDE to run on, for a self-contained out-of-the-box experience.
Individual NetBeans committers may provide additional binary packages as a convenience. While built using the Apache NetBeans release, they are not releases of the Apache Software Foundation. They may include other contents (eg. JDK) under additional license terms. |
Deployment Platforms
The Apache NetBeans 17 binary releases require JDK 11+, and officially support running on JDK 11, 17 and 19.
Known Issues
Building from Source
Community Approval
As in any other Apache Project, the Apache NetBeans Community approved this release through the following voting processes in our mailing lists:
Earlier Releases
Please visit the Apache NetBeans Download page for further details.
About
Community
Participate
Get Help
Download
Licensed under the Apache license, version 2.0
Apache, Apache NetBeans, NetBeans, the Apache feather logo and the Apache NetBeans logo are trademarks of The Apache Software Foundation.
Oracle and Java are registered trademarks of Oracle and/or its affiliates.
The Apache NetBeans website conforms to the Apache Software Foundation Privacy Policy
Overview of JDK 8 Support in NetBeans IDE
NetBeans IDE supports JDK 8 features, such as lambda expressions, repeatable annotations, compact profiles, etc. When these constructs are used in your code, the IDE recognizes them, correctly highlights errors, and lets you automatically fix syntax. Thus, NetBeans IDE helps you write code that is compatible with Java SE 8 Release Contents Early Draft Review Specification.
In this tutorial, you will learn how to get started with JDK 8 in NetBeans IDE and how to use the IDE support for such Java SE 8 features as compact profiles, lambda expressions, and repeating annotations.
To complete this tutorial, you need the software and resources listed in the following table.
Enabling JDK 8 Support in NetBeans IDE
After JDK 8 is downloaded and installed on your system, it needs to be registered in the IDE as follows:
- In the IDE, choose Tools > Java Platforms from the main menu.
- Click Add Platform in the Java Platform Manager dialog.
- In the Add Java Platform dialog, select Java Standard Edition and click Next.
- Specify the directory that contains the JDK and click Next.
- Verify that the default locations of the Platform Sources zip file and API documentation are valid. Click Finish to close the Add Java Platform dialog box. JDK 8 is registered as a platform in the IDE.
Configuring a Project to use JDK 8
After you registered JDK 8 in the IDE, your project needs to be configured to use JDK 8 for compilation, running, and debugging.
We will start by creating a new Java SE project with the Anagram game example which is shipped with NetBeans IDE.
- In the IDE, choose File > New Project.
- In the New Project wizard, expand the Samples category and select Java.
- Choose Anagram Game in the Projects list. Then click Next.
- In the Name and Location panel, leave the default values for the Project Name and Project Location fields.
- Click Finish. The IDE creates and opens the Java SE project in the Projects window.
To configure your project to use JDK 8:
- Right-click the AnagramGame project in the Projects window and select Properties from the context menu.
- In the Project Properties dialog box, choose the Libraries category and set JDK 1.8 as the Java Platform.
Using Compact Profiles Support
Java SE 8 introduces subset profiles of the Java SE platform specification that can be used to deploy and run applications that do not require the entire platform.
Three profiles that have been defined so far are named compact1, compact2, and compact3. Each profile specifies a particular set of Java API packages and contains all of the APIs in profiles smaller than itself: compact1 is a subset of compact2, which is a subset of compact3, which in its turn is a subset of the full JRE. The table below lists packages that are comprised in each profile.
* java.lang * java.io * java.nio * java.text * java.math * java.net * javax.net * java.util * java.util.logging * java.security * javax.crypto * javax.security
compact1 plus the following:
* java.sql * javax.sql * javax.xml * org.w3c.dom * org.xml.sax * java.rmi * javax.rmi * javax.transaction
compact2 plus the following:
* java.lang.management * javax.management * javax.naming * javax.sql.rowset * javax.security.auth.kerberos * org.ietf.jgss * javax.script * javax.xml.crypto * java.util.prefs * javax.security.sasl * javax.security.acl * java.lang.instrument * javax.annotation.processing * javax.lang.model * javax.lang.model.element * javax.lang.model.type * javax.lang.model.util * javax.tools
compact3 plus the following:
The IDE allows you to switch between the profiles and the full JRE when needed.
To set a project profile for a Java SE Project:
- Right-cick a project and choose Properties from the context menu.
- In the Project Properties dialog box, select the Sources category.
- Use the Profile drop-down list to specify the JDK 8 profile that your application will support.
To see how the IDE checks whether classes used in your project belong to the specified profile, select Compact1 as a profile for the AnagramGame project and click OK. The IDE displays errors to notify that the AnagramGame project is not compliant with the compact1 profile.
You can go back and set the AnagramGame project’s profile to Full JRE which is supported by the Anagrams application.
Using Lambda Expressions Support
Lambda expressions address the bulkiness of anonymous inner classes by expressing the machinery of anonymous inner classes more compactly.
The general syntax of a lambda expression consists of a set of parameters, an arrow token, and a function body (either a single expression or a statement block):
NetBeans IDE detects pre-lambda expressions and displays the hints in the Editor proposing to turn such constructs into lambda expressions.
For example, the AnagramGame project features a pre-lambda construct in the Anagrams.java file as shown in the screenshot below.
After you click the light bulb in the margin or press Alt-Enter, the IDE shows the Use Lambda hint with a set of options available:
If the Use Lambda hint is selected, the IDE converts the anonymous inner class into a lambda expression.
If you choose the Run Inspect on option, the IDE displays the Inspect dialog box that allows to run a single Convert to Lambda inspection on the specified file.
For more information on initiating the Inspect operation in the IDE, see Using Hints in Source Code Analysis and Refactoring in Developing Applications with NetBeans IDE. |
After you press the Inspect button to launch the inspection, the IDE identifies all the pre-lambda constructs in the file and displays them in the Inspector window.
If you choose the Run Inspect&Transform on option, the IDE displays the Inspect and Transform dialog box that allows to run a single Convert to Lambda inspection (or a selected configuration) on the specified code and refactor it if needed.
For more information on initiating the Inspect and Transform operation, see Using Hints in Source Code Analysis and Refactoring in Developing Applications with NetBeans IDE. |
Using Repeating Annotations Support
Java SE 8 features include repeating annotations that enable you to apply annotations with the same type to a single program element, as shown in the following code example:
@ProjectServiceProvider(service=Foo.class,"org-nebeans-modules-j2seproject") @ProjectServiceProvider(service=Foo.class,"org-nebeans-modules-j2eeproject") public class MyService extends Foo <>
NetBeans IDE support for repeating annotations allows you to write code with the same annotations provided the repeatable and containing annotation types are declared:
- a repeatable annotation type must be marked with @Repeatable () , otherwise you get an error at compilation
- a containing annotation type must have a value element with an array type; the component type of the array type must be the repeatable annotation type
Downloading Apache NetBeans 18
Apache NetBeans 18 is available for download from your closest Apache mirror.
Binaries (Platform Independent):
Installers and Packages:
Officially, it is important that you verify the integrity of the downloaded files using the PGP signatures (.asc file) or a hash (.sha512 files). The PGP keys used to sign this release are available here.
Release Notes:
Community Installers
- Codelerity / Gj IT packages — Windows, macOS and Linux (.deb / .rpm / .AppImage) built with NBPackage. Most include a local JDK runtime for the IDE to run on, for a self-contained out-of-the-box experience.
Individual NetBeans committers may provide additional binary packages as a convenience. While built using the Apache NetBeans release, they are not releases of the Apache Software Foundation. They may include other contents (eg. JDK) under additional license terms. |
Deployment Platforms
The Apache NetBeans 18 binary releases require JDK 11+, and officially support running on JDK 11, 17 and 20.
Known Issues
Building from Source
Community Approval
As in any other Apache Project, the Apache NetBeans Community approved this release through the following voting processes in our mailing lists:
Earlier Releases
Please visit the Apache NetBeans Download page for further details.
About
Community
Participate
Get Help
Download
Licensed under the Apache license, version 2.0
Apache, Apache NetBeans, NetBeans, the Apache feather logo and the Apache NetBeans logo are trademarks of The Apache Software Foundation.
Oracle and Java are registered trademarks of Oracle and/or its affiliates.
The Apache NetBeans website conforms to the Apache Software Foundation Privacy Policy