Choosing your Java IDE – InfoWorld

Lightweight java ide

Eclipse has extensive help and documentation, of different ages, currencies and utilities. It is not unusual to find that the documentation includes images that do not match the current version of the software, or that the keystrokes for your operating system are different from those shown in the help document. I’m afraid it’s one of the common problems with open source projects: documentation can delay software by months or even years. Eclipse has more than its share of documentation problems because the ecosystem is so large.

Cost: Free

, open source.

Platforms: Linux, macOS, Solaris, Windows

. NetBeans The

NetBeans

Java IDE began 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 as you type and helps you with documentation pop-ups 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 your code without disrupting it. It performs source code analysis and offers a rich set of suggestions for quickly correcting or improving your code. NetBeans still includes a design tool for Swing GUIs, formerly known as “Project Matisse”. (Does anyone still build Swing GUIs?)

Figure 3. This is NetBeans working with the code for the Neo4j graph database. Note the extensive functionality in the context menu and its refactoring submenu. The output at the bottom right comes from a Troubleshoot operation in the project to download missing dependency artifacts.

The Inspect & Transform tool allows you to run inspections on your codebase, while automatically correcting your code. I always make sure I’ve checked all my code and run all my unit tests correctly before running tools that can make radical changes; I have been burned more than once by automatic “fixes” that cause regressions.

Build, debug

, and profile

NetBeans has good built-in support for Maven, Ant, and Gradle. It also includes an attractive (and useful) graphical view for Maven dependencies.

The NetBeans Java debugger is good, though conventional. A standalone visual debugger allows you to take GUI snapshots and visually explore the GUI of JavaFX and Swing applications. The NetBeans profiler is very good at understanding CPU and memory usage, and has good tools for finding memory leaks.

Cost: Free, open source

.

Platforms: Windows, Linux, macOS, BSD

.

Comparing Java IDEs

,

I’ve personally used Eclipse, NetBeans, and IntelliJ IDEA over the years, in that chronological order. After each change, I felt like I had improved my productivity once I got used to the new IDE. But even after believing that I had firmly switched to IntelliJ, there were certain situations where I had to go back 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’ve also used Visual Studio Code with the Java Extension Pack, which I like for smaller projects.

I have full-time Java developer friends who use and swear by each of the big three IDEs. 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 not use Eclipse. Even though it was once the most popular Java IDE, it has the steepest learning curve and the greatest potential for confusion, both in everyday 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 when installing an incompatible set of plugins. Sadly, I’ve had to remove my broken Eclipse installation and start over with an official distribution package at least half a dozen times over the years. At this point, I always start over when a new Eclipse “launch train” comes out in June.

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

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

Lightweight Java IDE

While most people develop Java best with IntelliJ, NetBeans, or Eclipse, there are still cases where you might want a lightweight IDE, or even a programming editor like Sublime Text, emacs, or vim that has support for Java plugins

.

Visual Studio Code with Extension Pack for Java is very good and relatively lightweight as a Java IDE. Without Java extensions, Visual Studio Code is simply fine as a Java editor. Red Hat language support for the Java extension, one of the six elements of the extension pack, provides Java language support through Eclipse JDT Language Server, which in turn uses Eclipse JDT, M2Eclipse, and Buildship. Java language support goes as far as refactoring, which can be found in context menus.

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

  • DrJava is a free and lightweight development environment for writing Java programs. Designed for student use at Rice University, it currently has over 3 million downloads. DrJava is meant to encourage test-based software development. It includes an intelligent program editor, an interactions panel 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’s an introductory college textbook on learning object-oriented programming with BlueJ. At the time of writing, the current build of BlueJ is version 5.0.3, released on March 28, 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 workspace server for developers. Che supports Java along with C++, JavaScript, Python, PHP, Ruby and SQL. Eclipse Che supports multiple IDEs, including VS Code, Jetbrains IDEs like IntelliJ IDEA, and Eclipse Thea, and runs them on Kubernetes pods.

Tips

for choosing an IDE

While people often choose a personal Java IDE and use it for all their projects, sometimes there can 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’s not completely necessary.

For example, if a team project is hosted on GitHub, your life will be easier if your IDE supports GitHub. That’s not an absolute requirement, though: 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 any build system that has been adopted by the team. If it’s Maven, for example, you don’t want to have to reinvent the build system in Ant for your local testing. Fortunately, all three big Java IDEs support Ant, Maven, and Gradle, either out of the box or with a plugin. That’s not necessarily the case with lightweight IDEs.

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

It helps a lot 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 JPA entity classes and expressions (as IntelliJ does), it’s likely to spend less time on your JPA-related code. And if the IDE supports the test framework and test runner used by the project, you can perform tests without leaving your workspace.

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

Contact US