Choosing your Java IDE

Which Java IDE is best? Compare IntelliJ IDEA , Eclipse, and NetBeans for features, usability, and compatibility with your favorite tools and frameworks.

1 2 Page 2
Page 2 of 2

Eclipse has extensive help and documentation, of varying age, currency, and utility. It’s not unusual to discover that the documentation includes images that don’t match the current version of the software, or that the keystrokes for your operating system are different from the ones shown in the help doc. I’m afraid it’s one of the common problems with open source projects: the documentation can lag the software by months or even years. Eclipse has more than its share of documentation issues because the ecosystem is so big.

Cost: Free, open source.

Platforms: Linux, macOS, Solaris, Windows.

NetBeans

The NetBeans Java IDE started life as a university student project in Prague in 1996, became a commercial product in 1997, was bought by Sun in 1999, and was released to open source in 2000. The current version, Apache NetBeans 13, is precompiled for Windows, macOS, and Linux, and a portable subset runs on other systems that support Java. I downloaded the macOS installer.

NetBeans has fewer plugins than Eclipse, but they are less likely to interfere with each other. NetBeans 13 can automatically add features as you need them. It requires JDK 11+, and officially supports running on JDK 11 and JDK 17.

NetBeans 13 includes Java SE JDK 14 as its default platform for code. You can install additional Java platforms as needed, including Java Standard Edition 8 and OpenJDK up to version 18.

Editing and refactoring

The language-aware NetBeans editor detects errors while you type and assists you with documentation popups and smart code completion. It seems to do so with fewer noticeable pauses than Eclipse and slightly more of them than IntelliJ IDEA. NetBeans also offers a full range of refactoring tools (see Figure 3) to allow you to restructure code without breaking it. It performs source code analysis and offers an extensive set of hints to quickly fix or enhance your code. NetBeans still includes a design tool for Swing GUIs, previously known as “Project Matisse.” (Does anyone still build Swing GUIs?)

NetBeans IDE IDG

Figure 3. This is NetBeans working with the code for the Neo4j graph database. Notice the extensive functionality in the context menu and its refactor submenu. The output at the bottom right is from a Resolve Project Problems operation to download missing dependency artifacts.

The Inspect & Transform tool lets you run inspections across your codebase, while automatically fixing your code. I always make sure I’ve checked in all my code and run all my unit tests successfully before running tools that can make sweeping changes; I’ve been burnt more than once by automatic “fixes” that cause regressions.

Building, debugging, and profiling

NetBeans has good built-in support for Maven, Ant, and Gradle. It also includes a sexy (and useful) graph view for Maven dependencies.

The NetBeans Java debugger is good, albeit conventional. A separate visual debugger lets you take GUI snapshots and visually explore the GUI of JavaFX and Swing applications. The NetBeans profiler is very nice for understanding both CPU and memory use, and has good tools for finding memory leaks.

Cost: Free, open source.

Platforms: Windows, Linux, macOS, BSD.

Comparing Java IDEs

I personally have used Eclipse, NetBeans, and IntelliJ IDEA over the years, in that chronological order. After each switch, I felt that I had improved my productivity once I got used to the new IDE. But even after I believed I had firmly switched to IntelliJ, there were certain situations when I had to return to another Java IDE—such as the period when Eclipse was the only IDE supported for Android development. (The current official Android IDE is based on IntelliJ IDEA.) I have also used Visual Studio Code with the Extension Pack for Java, which I like for smaller projects.

I have full-time Java developer friends who use and swear by each of the big three IDEs. The IntelliJ IDEA users in particular are as loyal to their IDE as Visual Studio C++ and C# coders are to theirs, and claim that their productivity gains returned the cost of their annual subscriptions within a few weeks of use. NetBeans and Eclipse users are almost as loyal to their choices, and some wonder why people pay money for IntelliJ.

I tend to recommend that new Java coders do not use Eclipse. Even though it once was the most popular Java IDE, it has the steepest learning curve and the most potential for confusion, both in daily use and when maintaining the IDE. The many perspectives and views offer all sorts of functionality, but switching from one perspective to another can be jarring and disturb your flow.

Eclipse has the largest plugin ecosystem of any IDE, and the greatest tendency to become unusable from installing an incompatible set of plugins. Sadly, I’ve had to delete my broken Eclipse installation and start over with an official distribution bundle at least half a dozen times over the years. At this point, I always start fresh when a new Eclipse “release train” comes out in June.

NetBeans is good enough for most people, and has a nice profiler. I use it in a pinch, but I still prefer IntelliJ IDEA Ultimate.

For new Java coders without a budget for tools, the choice is between NetBeans and IntelliJ IDEA Community Edition. If you’re coding Java servers with little or no budget for tools, then NetBeans might be the better choice. Remember that students, open source developers, and others can qualify for a free or discounted copy of IntelliJ IDEA Ultimate.

Lightweight Java IDEs

While most people do best developing Java with IntelliJ, NetBeans, or Eclipse, there are still cases when you might want a lightweight IDE, or even a programming editor such as Sublime Text, emacs, or vim that has Java plugin support.

Visual Studio Code with the Extension Pack for Java is very good and relatively lightweight as a Java IDE. Without the Java extensions, Visual Studio Code is merely okay as a Java editor. Red Hat's Language support for Java extension, one of the six items in the extension pack, provides Java language support via the Eclipse JDT Language Server, which in turn utilizes Eclipse JDT, M2Eclipse, and Buildship. The Java language support goes all the way up to refactoring, which can be found in the context menus.

Assuming you really do want a lightweight IDE, there are several reasonable options:

  • DrJava is a free, lightweight development environment for writing Java programs. Designed for student use at Rice University, it currently has over 3 million downloads. DrJava is intended to foster test-driven software development. It includes an intelligent program editor, an interactions pane for evaluating program text, a source-level debugger, and a unit testing tool. The latest version of DrJava is dated 2019 and supports Java 8.
  • BlueJ is a free Java development environment designed for beginners at the University of Kent and supported by Oracle. BlueJ has a deliberately smaller and simpler interface than professional environments like NetBeans or Eclipse, and there is an introductory college textbook about learning object-oriented programming with BlueJ. As of this writing, the current build of BlueJ is Version 5.0.3, released 28 March 2022, which requires Java 11 or higher.
  • JCreator is a lightweight Java IDE for Windows, written in C++ for performance reasons. Originally, the paid Pro version had a debugger, Ant support, and code wizards; the free version did not. The current JCreator download is a trial version.
  • Eclipse Che is a browser- and cloud-based IDE and developer workspace server. Che supports Java along with C++, JavaScript, Python, PHP, Ruby, and SQL. Eclipse Che supports multiple IDEs, including VS Code, JetBrains IDEs such as IntelliJ IDEA, and Eclipse Thea, and runs them in Kubernetes pods.

Tips for choosing an IDE

While people often choose a personal Java IDE and use it for all their projects, there can sometimes be project-based considerations for choosing an IDE. The easy answer would be to use the same IDE as the rest of the team, but that isn’t completely necessary.

For example, if a team project is hosted on GitHub, then your life will be easier if your IDE supports GitHub. That isn’t an absolute requirement, however: you can always use a GitHub client or git command line and switch back and forth to your IDE.

You really want your IDE to support whatever build system has been adopted by the team. If it is Maven, for example, you don’t want to have to reinvent the build system in Ant for your local testing. Fortunately, the big three Java IDEs all support Ant, Maven, and Gradle, either out of the box or with a plugin. That isn’t necessarily the case with lightweight IDEs.

You are going to want your IDE to support the JRE version that is standard for the project; if there’s a version mismatch, you will run into bugs that the rest of the team can’t reproduce. That’s not a situation you want to create. Fortunately, JRE mismatches are more often configuration errors than errors caused by lack of support in the IDE: the exceptional case happens briefly when an IDE hasn’t yet released an update for a new Java version.

It helps a great deal if your IDE has strong support for the frameworks and technologies used in your project. You can get by without that, but if, for example, the IDE knows how JPA statements relate to entity classes and JPA expressions (as IntelliJ does), then you are likely to spend less time on your JPA-related code. And if the IDE supports the testing framework and test runner used by the project, you’ll be able to test without leaving your workspace.

Finally, it helps if your IDE can connect with the ticketing and bug tracking system the project uses. Again, you can get by using a standalone or web client for, say, JIRA, but you’ll be more productive if you can check in your tickets directly from your IDE. 

At a Glance

Copyright © 2022 IDG Communications, Inc.

1 2 Page 2
Page 2 of 2