Configuring NetBeans IDE for Jakarta EE 9 Development
Jakarta EE 9 marked a pivotal shift for Java enterprise developers, moving namespaces from javax to jakarta and updating the platform for cloud-native workloads. For engineers in Sydney, Melbourne, Brisbane, and Perth who rely on a stable IDE, getting NetBeans ready for this change is more than an ordinary upgrade. Pairing a current Apache NetBeans release, the Jakarta EE 9 plugin, and a certified application server prevents compile errors caused by mismatched APIs.
Teams across Australia often operate across different time zones, between the AEST corridor stretching through Queensland and the AWST window used in Western Australia. Configuring the IDE once, with all Jakarta libraries bundled correctly, removes the need to rebuild workstations when switching branches. The sections below cover installation, plugin activation, project setup, dependency tuning, server pairing, sample bean coding, and debugging habits.
Installing the Right NetBeans Build
Apache NetBeans 12 LTS or newer is the baseline for Jakarta EE 9 work. Earlier branches still target javax.* APIs and lack the runtime libraries adopted after the Eclipse Foundation transfer. Pick the bundle labelled "NetBeans IDE" with the Web and Java EE feature set from the official Apache downloads page.
Linux developers often prefer the installer script that unpacks into /opt. Windows users on Australian hardware should confirm a 64-bit JDK 11 or 17 is installed before continuing, because Payara and GlassFish builds expect the LTS line. After the installer finishes, verify the splash screen reports at least version 12.4.
Activating Jakarta EE 9 Support
The Jakarta EE 9 plugin must be enabled manually even on a recent build. Open Tools → Plugins, switch to the Available Plugins tab, and search for "Jakarta EE". The relevant module appears as "Jakarta EE 9 Web and EE APIs". Tick it, accept the licence, and let the installer fetch the JARs. A restart is required for the new templates to register with the New Project wizard.
After the IDE restarts, navigate to Tools → Servers to confirm GlassFish and Payara entries recognise the jakarta.* namespace. Teams based in NSW sometimes need to whitelist the Apache mirror endpoints through their corporate firewall before the plugin download completes successfully.
Building Your First Jakarta EE Application
Click File → New Project and choose Java EE Application or Maven Web Application depending on the team's preferred build system. The wizard exposes a Jakarta EE version dropdown once the plugin is active; pick 9.0 from the list. Choose a context path that maps cleanly to the chosen server and avoid spaces that confuse the deployer.
Deploying the starter is a useful smoke test. Right-click the project, choose Run, and the IDE packages the WAR, pushes it to the server, and opens the browser at the application index page. Behind a NBN FTTC line with port 8080 blocked, the server can be rebound to 8088 without losing the IDE integration.
Adjusting Dependencies for the New Namespace
Maven projects need a quick edit to the pom.xml. Replace every javax.servlet reference with jakarta.servlet and bump the version range to 5.0.0. The persistence.xml descriptor should reference jakarta.persistence rather than the legacy javax.persistence. ANT-based projects can let the IDE-managed libraries refresh automatically once the new server is selected.
A codebase grep exposes stragglers. Libraries such as Hibernate Validator and Apache CXF were repackaged under the jakarta group ID for the 9 series, so stale imports will surface as compile errors. A project-wide search for the string "javax.ejb" normally highlights every line that needs adjustment.
Pairing NetBeans with a Compatible Server
Jakarta EE 9 needs a Jakarta EE 9 server. Payara Server 5.2021.6 or later, Eclipse GlassFish 6.2, and Open Liberty 21.0.0.12 onward all qualify. Install the runtime locally and register it inside NetBeans through the Servers dialog, pointing the IDE at the installation root. The IDE scans the modules and lists the supported profiles, typically web and full.
Payara and GlassFish both ship the jakarta.* JARs that match the platform specification. Developers based in Adelaide often standardise on Open Liberty for its compact footprint and tight OpenJ9 integration; a quickstart zip can be unpacked and registered in less than five minutes.
| Server | Jakarta EE support | Licence | Footprint | Best for |
|---|---|---|---|---|
| Eclipse GlassFish 6.2 | Full | EPL + GPL with Classpath | ~120 MB | Reference implementation, training |
| Payara Server 2021.6+ | Full | CDDL + GPL | ~140 MB | Production clusters, failover tests |
| Open Liberty 21.0.0.12+ | Web and Full | EPL | ~60 MB | Microservices, container workloads |
| Apache TomEE 9.0 | Web Profile | Apache 2.0 | ~80 MB | Tomcat-compatible deployments |
Implementing a Stateful Session Bean
Stateful beans remain a cornerstone for conversational business logic, from shopping carts to multi-step onboarding flows. In a Jakarta EE 9 project the bean is annotated with @Stateful from the jakarta.ejb package rather than javax.ejb. Inside NetBeans, select the EJB folder, choose Session Bean, and pick Stateful from the type menu.
For a complete reference implementation, the tutorial at stateful session bean walks through the Local interface, the bean implementation, and a servlet that injects it. The guide demonstrates @PostConstruct and @PreDestroy adapted to the new namespace, plus a JUnit test that runs against an embedded container. Drop the example into a checkout and the IDE compiles it without further configuration.
Debugging, Logging, and Final Recommendations
Attach breakpoints inside the EJB and run the project in Debug mode; NetBeans suspends on each invocation and surfaces variable values in the navigator. Server logs stream into the Output window, which is useful when troubleshooting cluster behaviour on a staging environment hosted in an Australian region.
Enable Hot Reload through the project properties by toggling Compile on Save. Saving an EJB method triggers a hot redeploy that drops the redeploy cycle from thirty seconds to two. Combine that with conditional breakpoints and structured logging markers, especially when shipping fixes across the east-west divide from Western Australia.
- Verify the JDK matches the server's supported matrix before installing the IDE.
- Run the plugin update immediately after the first launch, even on a fresh machine.
- Pin server and library versions in project properties to avoid surprise upgrades.
- Keep a separate workspace dedicated to legacy
javax.*projects so Jakarta work stays isolated. - Add a CI check that fails the build on stray
javax.*imports to enforce namespace consistency. - Subscribe to ACS community channels or the Apache NetBeans user list to catch breaking changes early.