JavaRush /Java Blog /Random EN /Eclipse, NetBeans or IntelliJ IDEA? Choosing an IDE for J...
Bender
Level 1
Маунтин-Вью

Eclipse, NetBeans or IntelliJ IDEA? Choosing an IDE for Java Development

Published in the Random EN group
Eclipse, NetBeans or IntelliJ IDEA?  Choosing an IDE for Java development - 1We present to your attention an adaptation of an article by Martin Heller, programmer and editor of the JavaWorld resource. You've probably already heard about the top three most popular IDEs for Java development. 90 percent of industrial programmers use either Eclipse, NetBeans or IntelliJ IDEA, and each of these IDEs has its own advantages and disadvantages. In this article we will try to describe them so that you understand which one is right for you. Although, of course, it is better to try all three at work and find out what works best for you. No review can replace this.

What is a development environment?

The very short answer is that a development environment is a program or multiple programs that you use to create programs. This process actually includes writing the code, debugging it, launching it, and integrating it with version control systems. If earlier developers often used a simple text editor (sometimes even without syntax highlighting), such as Notepad and the command line, now they most often use all-in-one processors, integrated development environments or IDEs.

What is an IDE?

Integrated development environment or in English Integrated development environment - IDE - is a program that contains tools for software development. Typically, a modern development environment includes:
  • Text editor with code highlighting;
  • compiler or interpreter;
  • Class Browser, Object Inspector, and Class Hierarchy Diagram;
  • assembly automation tools;
  • debugger;
  • tools for integration with version control systems (Git);
  • tools to simplify the design of a graphical user interface.
I've worked with these IDEs before, but for this study I installed IntelliJ IDEA Ultimate 2016.2, Eclipse Neon Java EE, and NetBeans 8.1 Java EE on a MacBook Pro laptop. I tested the IDE on several open source Java projects.

What to Expect from an IDE

A modern IDE for a “healthy Java developer” should support Java 8, Scala, Groovy, as well as other Java virtual machine languages ​​that he regularly uses. Support for the main application servers and the most popular web frameworks, including Spring MVC, JSF, Struts, GWT, Play, Wicket, Grails and Vaadin, would also be useful. The IDE must be compatible with any version control system builds, such as Ant, Maven or Gradle, along with Git, SVN, CVS, Mercurial or Bazaar. Additionally, for the development environment it is important to be able to work with databases and the client layer of your stack, to have support for built-in JavaScript, TypeScript, HTML, SQL, JavaServer Pages, Hibernate, as well as the Java Persistence API. Finally, it is logical to hope that the IDE will allow you to edit, create, debug and test systems without unnecessary stress. Ideally, the development environment supports not only intelligent code completion, but also intelligent refactoring and code metrics. In many cases, it will be useful to support testing frameworks and stubs. If your team uses a ticket system and CI/CD, you need the IDE to be able to connect to them. And decide whether you need deployment and debugging in containers and clouds. We have listed only the basic expectations (perhaps you have something to add), and now let’s take a closer look at our rivals.

IntelliJ IDEA

Eclipse, NetBeans or IntelliJ IDEA?  Choosing an IDE for Java development - 2In terms of features and price, IntelliJ IDEA comes in two versions: the free Community edition, and the paid Ultimate edition with extended functionality. Community edition is designed for JVM and Android development. The free version supports Java, Kotlin, Groovy and Scala; Android; Maven, Gradle and SBT; works with version control systems Git, SVN, Mercurial and CVS. Ultimate edition is suitable for web and enterprise development. This version of the IDE works not only with Git, SVN, Mercurial and CVS, but also with Perforce, ClearCase and TFS; in it you can write in JavaScript and TypeScript; Naturally, there is support for Java EE, Spring, GWT, Vaadin, Play, Grails and a number of other frameworks. And, of course, we couldn’t do without SQL and tools for working with databases. The idea that guides the developers of this IDE when forming a pricing policy is that its commercial version (Ultimate) will take its place on the computers of professionals, due to which their productivity will increase. If a Java programmer earns $50 thousand annually (or even more), the return on investment spent on the paid IDE IntelliJ IDEA ($500 for an annual subscription) will happen very quickly due to even a slight acceleration of his work. In subsequent years, the price for businesses falls, for startups and freelancers it is significantly lower, and for students, teachers, Java champions and open source developers it is completely free. IntelliJ IDEA impresses with its deep code understanding, smart ergonomics, built-in development features, and multi-language support. Eclipse, NetBeans or IntelliJ IDEA?  Choosing an IDE for Java development - 3
Figure 1. IntelliJ IDEA shows the number of warnings and guesses based on statistical analysis of Java code. You can study the assumptions in more detail by clicking on them, as shown in the picture; in many cases you will receive a list with choices and correction options.

Deep understanding of code

Syntax highlighting and simple code completion are commonplace for any modern Java editors. IDEA went further by offering “smart autocompletion.” This term means that the development environment shows a list of the most relevant symbols applicable in a given context. The list of symbols depends not only on the context as such, the “generally accepted” one, but on the developer’s programming style, on how often he uses certain operators. “Chain Completion” even shows a list of applicable symbols that are allowed through methods or getters in the current context. Additionally, for static members or constants, IDEA automatically adds any necessary import statements. In all cases of autocompletion, IDEA attempts to guess the type of the symbol at runtime, refine its selection, and even apply a type cast if necessary. Java code often includes snippets from other languages ​​as strings. IDEA can inject SQL, XPath, HTML, CSS, or JavaScript code into Java string literals. In this sense, the IDE can refactor code in multiple languages. For example, if you rename a class in a JPA mapping, IDEA will update the corresponding JPA entity and expression class. When refactoring a piece of code, the developer has one (quite natural) desire: for all duplicates of this code to also be refactored. IDEA Ultimate finds duplicates and similar fragments and also applies refactoring to them. IntelliJ IDEA parses code upon loading and directly as you enter it. It points out suspected problems (as in our image above) and optionally offers a list of likely quick fixes to the problems found.

Ergonomics

Eclipse, NetBeans or IntelliJ IDEA?  Choosing an IDE for Java development - 4IntelliJ IDEA is designed so as not to knock a developer out of a flowing productivity state once he or she is already in it. The Project window, shown in the first picture on the left, disappears with a simple mouse click so that the programmer can focus on the code editor window. For all actions that are needed while writing code, there are key combinations for quickly calling them, including defining symbols in pop-up windows. At first, all these combinations are difficult to remember, but gradually you get used to them and only use them. However, even if the programmer does not use keyboard shortcuts, as practice shows, he gets used to working in IDEA easily and quickly. I would like to especially note the IDEA debugger: variable values ​​are displayed directly in the editor window, next to the corresponding source code. When the state of a variable changes, the highlight color also changes.

Built-in tools

IntelliJ IDEA provides a unified interface to most version control systems, including Git, SVN, Mercurial, CVS, Perforce, and TFS. You can manage changes directly in the IDE, which is very convenient. When I was testing IDEA, I had a desire to have the latest change in the source code show up in the editor window as an annotation (as happens, for example, in Visual Studio). As it turns out, IDEA has a special plugin for this. IDEA also comes with build tools, a test runtime, coverage tools, and a built-in terminal window. IntelliJ does not have its own profiler, but third-party ones can be connected to it using plugins. For example, YourKit, created by a former lead developer of JetBrains, or VisualVM (which is a repackaged version of the NetBeans profiler). Debugging in Java can be a pain when all sorts of mysterious things happen to classes that you don't have the source for. IDEA includes a decompiler for such cases. Server-side programming in Java requires frequent interaction with databases, so IDEA Ultimate programmers will appreciate the convenience of tools for working with SQL and databases. But if their capabilities are not enough for someone, you can purchase the IDEA Ultimate version with a built-in SQL IDE (DataGrip). However, it will be slightly more expensive than the regular IDEA Ultimate subscription. IntelliJ IDEA supports all major JVM application servers, and allows you to deploy and debug on these servers, which eliminates the difficulties familiar to all Java Enterprise programmers. IDEA also supports Docker (via a plugin that adds a special Docker tool window to the development environment. By the way, IDEA has a ton of plugins.  

A true polyglot

IDEA has expanded code support for Spring, Java EE, Grails, Play, Android, GWT, Vaadin, Thymeleaf, Android, React, AngularJS and other frameworks. You've probably noticed that not all of them are Java specific. IDEA “understands” other languages ​​straight out of the box - Groovy, Kotlin, Scala, JavaScript, TypeScript and SQL. If you don't see the language you're looking for in this list, there are currently 19 IntelliJ language plugins, specifically supporting R, Elm, and D.

Eclipse IDE

Eclipse, NetBeans or IntelliJ IDEA?  Choosing an IDE for Java development - 5 About 10 years ago, when asked about the best IDE, a Java developer answered confidently: Eclipse. For many years, this development environment confidently held the palm among Java IDEs. This environment is completely free, open source, written primarily in Java. However, its modular architecture allows Eclipse to be used with other languages. The Eclipse project, initiated by IBM, appeared in 2001. They wanted to replace the IBM Visual Age family of development environments based on Smalltalk. Well, the main goal, as even the name suggests, was to outshine Microsoft Visual Studio (eclipse in English means eclipse). Java's portability helps Eclipse be a cross-platform environment: this IDE runs on Linux, Mac OS X, Solaris, and Windows. For better or worse, the Java Standard Widget Toolkit (SWT) is at least partially responsible for the look and feel of Eclipse. Eclipse owes its performance (or, as some well-wishers say, lack thereof) to the JVM. Eclipse works quite slowly, since it is rooted in rather old hardware and ancient versions of the JVM. Even today it seems slow, especially if you attach a lot of plugins to it. Some of Eclipse's resource overhead can be attributed to its built-in incremental compiler, which runs whenever a file is loaded or code is updated. This is a useful thing; it catches errors when entering text. Regardless of the build, the Eclipse project maintains a content model that contains information about the hierarchy of types, references, and declarations of Java elements. The current version of Eclipse is called Neon (4.6.0). I installed Eclipse Java EE IDE for web developers (this is not the only option, you can choose something else). It contains a minimal Eclipse SDK and plugins are added on demand. By the way, working with plugins in this IDE is not for the faint of heart. Third-party plugins often conflict with each other, although their official specifications say nothing about this. Eclipse, NetBeans or IntelliJ IDEA?  Choosing an IDE for Java development - 6
Figure 2. From left to right, there are four Eclipse toolbars: Package Explorer, Java Editor, Java Class Structure, and Task List. The project loaded into Eclipse in this picture is the JUnit test framework. The panels can be easily swapped.

Plugin support

Eclipse's plugin ecosystem is both the IDE's strength and one of its main problems. It is because of the incompatibility of plugins that sometimes entire assemblies crash, and programmers have to start work all over again. There are currently over 1,700 plugins written for Eclipse, official and unofficial, which may or may not work great. Eclipse plugins support more than 100 programming languages ​​and almost 200 application development frameworks. Most Java servers are also supported: if you designate a new server connection from Eclipse, you'll be taken to a list of vendor folders where you'll find about 30 application servers. There will be as many as nine Apache Tomcat variants alone. Commercial vendors tend to bundle their solutions together: for example, there is only one Red Hat JBoss Middleware item, and inside you will find WildFly and EAP server tools, as well as JBoss AS.

Editing, refactoring and debugging

Your first experience with Eclipse can be confusing and even confusing. The first step is to set up Eclipse and get used to its conceptual architecture of workspaces, views, and views. This is all determined by the plugins you have installed. For server-side Java development, you will likely use the Java, Java EE, and Java browsing views, Package Explorer view, debugging view, web tools command synchronization view, database development view, and database debugging view . In practice, everything makes sense when you open the windows you need. Eclipse almost always offers several ways to solve a particular problem. For example, you can view code using the Java browsing perspective. What to choose is a matter of taste and choice. A special Java search allows you to find declarations, references and occurrences of Java packages, types, methods, fields. You can also use quick search access and preview. Common code patterns can be generated from code templates. Java Refactoring in Eclipse supports 23 operations, ranging from common renaming operations to less obvious transformations (as in Martin Fowler's book). Eclipse supports both local and remote debugging, provided you are using a JVM that supports remote debugging. Debugging is pretty standard: you define breakpoints and then view the variables in the debug tab. Of course, you can step through your code and evaluate expressions. Eclipse has a vast database of documentation of varying ages, values, and usefulness. Unfortunately, finding a picture in the instructions that does not correspond to the current version, for example, with an outdated interface and button layout, is a common occurrence for this IDE. Unfortunately, the problem of late documentation updates is very common for any source code projects.

NetBeans

Eclipse, NetBeans or IntelliJ IDEA?  Choosing an IDE for Java development - 7NetBeans began as a university student project in Prague in 1996. In 1997, the IDE became a commercial product, and in 1999 it was bought by Sun Microsystems (the parents of Java) and the following year presented an open source release. The current version 8.1 runs on machines running Windows, Mac OS X, Linux and Solaris. Well, the portable package can be run on any system for which a Java machine exists. I downloaded the Java EE bundle for myself, it is one of six possible download packages. This bundle supports JavaScript and HTML, GlassFish and Tomcat, but does not support PHP, C/C++/Fortran, Groovy and Grails: they can be obtained in the “All Inclusive” package (or simply “All”). However, if I wish, I can download support for the above languages ​​at any time by selecting the appropriate plugin (or any other). NetBeans has fewer of them than Eclipse, but they usually do not conflict with each other. This fall, Oracle (which acquired NetBeans after acquiring Sun Microsystems) decided to transfer this development environment under the wing of the Apache Software Foundation, along with all rights, source code, trademark, domain "netbeans.org" and a number of other infrastructure elements. Therefore, the future of the project is still vague, although the system previously had certain related privileges. Thus, it was NetBeans that was the first to receive support for Java 8 almost immediately after the release of the updated platform, and was called the “official IDE for Java 8.” However, a month after its release, this advantage was lost: it was then that other IDEs also received support for Java 8. However, I want to point out that NetBeans' Java 8 support is really good, and the IDE is great for weaving Java 8 tricks into "old" code. Its editors, code analyzers and converters will help the programmer upgrade the code using constructs typical of Java 8 - lambda expressions, functional operators and method references. The JavaScript plugins in NetBeans 8 do a great job of supporting Node.js and the latest JavaScript tools like Gulp and Mocha, as well as supporting the Nashorn JavaScript interpreter. Eclipse, NetBeans or IntelliJ IDEA?  Choosing an IDE for Java development - 8
Figure 3. Here NetBeans is running the same Maven-based project that IntelliJ IDEA was opened in Figure 1. Notice the enhanced functionality in the context menu and the refactoring submenu

Editing and refactoring

NetBeans Editor supports languages, detects errors as you type, and helps you with tooltips and smart code completion. According to the subjective feeling, the IDE copes with this task faster than Eclipse, but somewhat slower than IntelliJ IDEA. In addition, NetBeans has a full range of refactoring tools (as shown in Figure 3) that allow the programmer to restructure code without breaking it, perform source analysis, and also offers a wide range of hints for quick fixes or code extensions. NetBeans includes the Swing GUI design tool, formerly known as "Project Matisse". Developers highly appreciate the automated refactoring tool Inspect & Transform, introduced in NetBeans 7.1. It allows you to analyze the project code and make suggested improvements. Although personally, I prefer to test all my own code with unit tests first, and only then run tools that can make radical changes. I have repeatedly suffered from all sorts of automatic corrections that led to irreparable consequences.

Building, Debugging and Profiling

NetBeans has excellent native support for Maven and Ant, as well as a plugin for Gradle. I was very happy when I discovered that Maven projects were treated as “native” by the system. This means that they can simply be opened rather than imported. NetBeans also contains an attractive (and useful) graphical display for Maven dependencies. The NetBeans Java debugger is not bad, but it comes with some caveats. A separate visual debugger allows the programmer to take screenshots of the user graphical interface and explore the interfaces of applications made using JavaFX and Swing. The NetBeans profiler makes it more obvious how CPU and memory are used and has excellent tools for finding memory leaks.

Which Java IDE is better? Comparison of the trio of giants

I've used all three IDEs, Eclipse, NetBeans and IntelliJ IDEA, over the years in the chronological order listed. Every time I switched to a different IDE, I felt that my productivity increased. But even when I was firmly convinced that IDEA was my final choice, I sometimes had to return to one of the two remaining IDEs. This was the case, for example, at a time when Eclipse was the only tool that supported Android development (today there is Android Studio, the current official IDE for Android, it is based on IntelliJ IDEA). Of course, all three IDEs have their fans and detractors. I know a lot of Java developers who love IntelliJ IDEA, as well as loyal Visual Studio C++ and C# fans. More often than not, these people are happy with the fact that their productivity has increased, and the cost of the annual subscription is refunded after just a few weeks of using the paid version of IDEA. However, NetBeans and Eclipse users are also often attached to their tools and wonder why other programmers are willing to pay money for IDEA. I would advise new Java developers to stay away from Eclipse. Despite the fact that it is still the most popular IDE for Java, it is difficult for beginners: it is easy to get lost in the wilds of Eclipse, both during system deployment and during daily work. Eclipse has the most extensive plugin ecosystem of all IDEs, and is also the most likely to crash due to installing an incompatible set of these same plugins. Unfortunately, while using Eclipse, I repeatedly had to remove another broken assembly of this IDE and install a “clean” bundle. NetBeans is good for most developers, it has a great profiler, and I use it sometimes. However, I prefer to pay for IntelliJ IDEA Ultimate. And the future of NetBeans is still unclear. For new Java developers who don't have the budget to buy tools yet, I recommend using NetBeans or IntelliJ IDEA Community Edition depending on their needs. The first one is worth choosing for those who are coding Java servers, but only if you do not fall into the category of those who can get IntelliJ IDEA Ultimate for free or with a huge discount (students or those programmers who are developing an open source project).

"Light" Java IDE

Today, most Java developers use IDEA, NetBeans or Eclipse, but sometimes there is a need for lighter development environments or even code editors like Sublime Text, emacs or vim that support Java plugins. I've listed below reasonable options for those looking for something a little lighter:
  • DrJava — небольшая бесплатная среда разработки. Её создали для студентов Университета Райса, и она стала довольно популярной: DrJava загрузor уже более 2 млн раз. DrJava призвана развивать разработку, основанную на тестировании (test-driven development). Среда содержит «умный» редактор codeа, панель взаимодействия для оценки codeа applications, отладчик уровня источника и инструменты модульного тестирования.
  • BlueJ бесплатная среда разработки Java, созданная специалистами Кентского университета для начинающих программистов. Эта среда поддерживается Oracle. BlueJ отличается гораздо более лаконичным и простым интерфейсом, чем профессиональные IDE, такие, How NetBeans or Eclipse, и даже содержит специальный учебник по основам ООП.
  • JCreator — ещё одна небольшая Java IDE для Windows, написанная на C++ (из соображений увеличения производительности). Платная version Pro оснащена отладчиком, поддержкой Ant и code wizards, ну а бесплатная version (LE) — нет.
  • Eclipse Che — браузерная облачная IDE: Java, C++, JavaScript, Python, PHP, Ruby и SQL — список языков, которые она поддерживает. .

Выбор Java IDE в зависимости от проекта

I've tried to describe the important benefits of each of the three most significant Java IDEs and briefly mentioned their useful little rivals. To choose the right Java development environment, you need to weigh the pros and cons and match them with your needs and the needs of your projects. If you're joining a team, it's a good idea to use the same IDE as other developers, although it's not required. If your team hosts sources on GitHub, it will naturally be more convenient if your IDE supports GitHub. Yes, you can handle code transfer without an IDE using the GitHub client or the git command line. But how effective will such jumps between different systems be? It is also important that the IDE supports the build system. For example, if it's Maven, you're unlikely to want to rebuild the system in Ant for local testing. Luckily, all three big Java IDEs support Ant, Maven, and Gradle, either out of the box or with a plugin. But for “small” IDEs this may not be true. It is a natural desire for the development environment to support the version of the JRE that is used in the project. If the versions do not match, there is a high probability of getting a lot of extra bugs, which, for example, will appear in you, but not in other team members. It is unlikely that such a situation will have a good effect on your karma. Frankly, JRE inconsistency is more likely to occur due to configuration errors than due to lack of IDE support, unless the IDE has not yet updated to a new version of Java. Just believe that if your IDE fully supports the frameworks and technologies that are used in the project, it really helps speed up the work. You will most likely manage it anyway. But, if the IDE understands how JPA statements relate to JPA entity and expression classes (like IntelliJ), you will spend much less time on JPA-related code than if you completely misunderstand. Well, if the IDE supports the testing framework and the code executor used for the project, you can run tests without changing the working environment. This will also speed up the development process. Finally, work goes faster if the IDE is compatible with the project's bug tracking and ticket system. Again, you can use a standalone or web client, say JIRA, but it's hard to disagree that checking tickets is much faster without changing the window, while remaining directly in the IDE.

Free or paid?

After testing IntelliJ IDEA Ultimate, I got the feeling of the right development environment. A sort of Cadillac of the IDE world. I won't say unequivocally that IDEA is the best IDE for Java, but for me that's the case. Again, while it's not free, I think the productivity gains from using it are worth the annual subscription. For beginners who can't afford an annual IntelliJ IDEA Ultimate subscription, I recommend using NetBeans rather than Eclipse. Of course, the ecosystem of Eclipse plugins today is much more developed than that of any other IDE, but it is very overgrown and unkempt: a novice developer risks getting stuck in the jungle of IDE, Java and immersion in work will fade into the background. also touched on “lightweight” alternatives, two of which were developed specifically for educational purposes. Well, if you're just starting to learn languages ​​and prefer a minimalist environment, why not?
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION