Apache NetBeans 12.0 Features

Welcome to Apache NetBeans 12.0!

The LTS release of the Apache NetBeans 12 cycle is Apache NetBeans 12.0, which consolidates the feature releases 11.1, 11.2, and 11.3. Feature releases have not been tested as heavily as the LTS release, which passes through the NetCAT Community Acceptance process and is for these reasons the annual major release. For details, see the Apache NetBeans quarterly release cycle.

Below are the highlights of Apache NetBeans 12.0, for a full list, see the Apache NetBeans 12.0 Wiki.

Overview

Apache NetBeans 12.0 adds support for the latest Java language features, integrates new code donations from Oracle for Java Web development, enhances its best of breed Apache Maven tooling, brings multiple enhancements for users of Gradle, includes built-in features for Payara and WildFly for the first time, introduces new out of the box templates for JavaFX, upgrades and extends its PHP editor, provides new dark look and feel options, and includes a wide range of fixes.

All features provided by Apache NetBeans are supported out of the box, without additional plugins needing to be installed, and all for free. Apache NetBeans 12.0 is the first LTS release of NetBeans as a top level Apache project.

We would like to thank all contributors, the community, and the Apache Software Foundation for the great co-operation and enthusiasm enabling this complex and exciting project to continue to inspire and be of use to developers all over the world.

Java

The highlights of the enhancements in the Java area are focused on support for the latest Java language features.

Java Language Features

To use the latest Java language features (listed below) in the Java Editor, run Apache NetBeans on the JDK that provides those features, enabling Apache NetBeans to use the Java compiler from the JDK it runs on for its Java Editor support for those features.

In these scenarios, make sure to uninstall the NetBeans "nb-javac" fork, if it is installed, and to not install it when prompted to do so. The "nb-javac" fork does not support the latest Java language features and is mandatory only when you run Apache NetBeans on JDK 8. Over time, Apache NetBeans aims to move away completely from the "nb-javac" fork, except for when JDK 8 is used to run Apache NetBeans, since JDK 8 does not provide the capabilities enabling Apache NetBeans to use its Java compiler in support of its Java Editor features.

Java 14

  • JEP 359: Records (Preview Feature) — syntax coloring for the new "record" keyword; Navigator shows equals, hashCode, toString, etc; and formatting support for records.

record keyword
  • JEP 305: Pattern Matching for instanceof (Preview Feature)

ezgif.com video to gif

Java 13

  • JEP 355: Text Blocks (Preview) — Java editor hint has been introduced for converting to/from text blocks.

jdk13 textblock
TextBlockToString

Java 12

  • JEP 325: Switch Expressions (Preview) – code completion for JEP-325 preview feature for multiple case labels, as shown below.

code completion multiple case 2
JEP 12, introduced in JDK 12, provides for a preview language or VM feature, which "is a new feature of the Java SE Platform that is fully specified, fully implemented, and yet impermanent. It is available in a JDK feature release to provoke developer feedback based on real world use; this may lead to it becoming permanent in a future Java SE Platform".

Preview features can only be used if the Java compiler’s --enable-preview flag is set, as shown below for Maven.

<build>
   <plugins>
      <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.0</version>
          <configuration>
              <compilerArgs>
                    <arg>--enable-preview</arg>
              </compilerArgs>
         </configuration>
     </plugin>
  </plugins>
</build>

An example to add --enable-preview in Gradle:

tasks.withType(JavaCompile).each {
    it.options.compilerArgs.add('--enable-preview')
}

run.jvmArgs(['--enable-preview'])

Java 11

  • JEP 330: Launch Single-File Source-Code Programs — single Java source files can be created, outside of projects, in the Favorites window, and they can be run and debugged, if NetBeans is running on JDK 11 or later.

JavaFX

Two OpenJFX Gluon Maven artifacts are now registered in the New Project dialog, named "FXML JavaFX Maven Archetype (Gluon)" and "Simple JavaFX Maven Archetype (Gluon)", with their nbactions.xml files customized so that running and debugging can be done out of the box without any tweaking needed by the user.

openjfx gluon artifacts 600

Java EE

Currently, Apache NetBeans supports Java EE, though not yet Jakarta EE. The Jakarta EE APIs are identical to Java EE 8, though there are new JARs that are now packaged under the Eclipse Foundation and all APIs have been slightly renamed.

Support for Java EE Specifications

Java EE 8 support, for the first time in 11.1, for Maven-based and Gradle-based Web applications. The Java EE 8 support provides the ability to create Java EE 8 applications and deploy to a Java EE 8 container, with new "webapp-javaee8" Maven archetype created for use with Apache NetBeans.

new java ee 8

Support for JSF 2.3: CDI Changes for JSF Artifact Injection (introduced in 11.3), e.g., "f:websocket" is now supported.

javaee websocket 600

Support for Java EE Servers

  • GlassFish support to 5.0.1.

  • Payara integration out of the box for the first time, from 11.1, including Payara Platform 5.194/5.201 support and Payara Server Hot Deploy support.

  • Tomcat

  • WildFly integration out of the box for the first time, from 12.0.

Java Build Systems

Maven

The key new feature for Maven users in Apache NetBeans 12.0 is its support for Java language preview features, introduced in 11.1. Java compiler arguments, e.g., "--enable-preview", are passed to Java editor from Maven.

<build>
   <plugins>
      <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.0</version>
          <configuration>
              <compilerArgs>
                    <arg>--enable-preview</arg>
              </compilerArgs>
         </configuration>
     </plugin>
  </plugins>
</build>

An important fix has been done to enable JaCoCo Maven integration, in 11.1.

<plugin>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco-maven-plugin</artifactId>
    <version>0.8.3</version>
    <executions>
        <execution>
            <goals>
                <goal>prepare-agent</goal>
            </goals>
        </execution>
        <execution>
            <id>report</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>report</goal>
            </goals>
            <configuration>
               <outputDirectory>${project.reporting.outputDirectory}/jacoco_test</outputDirectory>
            </configuration>
        </execution>
    </executions>
</plugin>

Gradle

The key new feature for Gradle users in Apache NetBeans 12.0 is its support for Java EE.

gradle 12.0
Currently, Apache NetBeans supports Java EE, though not yet Jakarta EE. The Jakarta EE APIs are identical to Java EE 8, though there are new JARs that are now packaged under the Eclipse Foundation and all APIs have been slightly renamed.

However, there are multiple other new features, enhancements, and fixes for Gradle users, which together provide comprehensive Gradle tooling for the first time and fills in multiple gaps. These include upgraded Gradle Tooling API to 6.3, new Java Frontend Application wizard for Gradle, debugger support for Gradle Web projects, support for custom Gradle Home, support for composite projects, Kotlin-based Gradle projects, and forceable reloading of Gradle projects.

PHP, JavaScript, and HTML

The key new feature for PHP users in Apache NetBeans 12.0 is its support for PHP 7.4.

php 7.4

Further details on new support for PHP 7.4 features are provided here and see all fixes in the PHP area in 12.0 here.

In addition, Apache NetBeans 12.0 integrates out of the box a TypeScript editor, introduced in 11.3.

typescript 11.3

For users of the Chrome/NetBeans integration, a fix has been integrated enabling the Chrome connector to work correctly with Apache NetBeans, since 11.3.

C/C++

The donation of the NetBeans C and C++ features from Oracle to Apache has been completed in the 11.3 timeframe, though the code has not yet been integrated into Apache NetBeans. This is anticipated to be a large task and may take some time, involving not only license changes and IP clearance in Apache, though also potentially code changes since not everything that was part of these features in Oracle was able to be donated by Oracle to Apache.

Until the code integration is complete, go to the Plugin Manager, enable the NetBeans IDE 8.2 Update Center, which lets you install the NetBeans IDE 8.2 modules providing C and C++ features.

General

Appearance

A key focus of the 12.0 release is around appearance, since the NetBeans dark look and feels support (Dark Metal and Dark Nimbus) has been donated by Oracle to Apache, while FlatLaf, a completely new look and feel by Karl Tauber from FormDev Software GmbH, has been integrated. Also, enhancements for HiDPI on Windows have been introduced.

FlatLaf Look and Feel Support

FlatLaf 11.3 small

Dark Metal and Dark Nimbus Look and Feel Support

dark metal nimbus 11.3 small

Miscellaneous

  • Windows LAF: Fixed tiny or huge GUI font size on various HiDPI configurations, fixed incorrectly sized component icons (radio buttons, checkboxes, project tree expansion handles etc.) on various HiDPI configurations, fixed uneven borders on text components on non-integral HiDPI scaling factors, e.g., 150%, fixed broken tab dragging (window rearrangements) on HiDPI displays.

  • Toolbar browser icon take advantage of improved HiDPI scaling.

  • Implemented simplified HeapView widget.

  • Fixed incorrectly positioned line-width marker (i.e., shown at 82 characters instead of 80 characters), and inaccurate tab alignments. This bug existed at certain editor zoom levels on Windows, Linux, and MacOS, including on non-HiDPI screens.

  • Fixed clipped file names in Projects window and Files window on Windows on HiDPI screens.