Now, on to the next step up in coding environments: the IDE!
Why use an IDE?
You have used text editors like Notepad and VS Studio to write code on your own computer, but if you're serious about coding, it isn't enough. Notepad is fairly limited, as you saw. VS Code is a great tool to use for Java development, but it is just a text editor with extensions. It is not intended for handling large-scale Java projects that are used in a production environment.
An IDE is software specifically created for developers to make software and application development easier. It's a one-stop shop for development because it has a text editor, debugger and compiler all in one tool - no downloading extra features or having to install extensions. On top of that, an IDE makes software development with built-in systems for different types of projects as well as for building software. A simple code editor can’t do that!
There are lots of IDEs out there that you can use to code Java. We'll take a look at a popular one called Eclipse. It's equipped to handle many types of projects especially complex ones with multiple files. It even has a Git extension that allows easier access to a code repository like Github. Having this Git extension is crucial because repositories are a key way developers share code when working together.
It also has built-in build systems and project systems, which allow you to create more complex projects. Eclipse can not only build all your source code to run a program with multiple files, but it also has wizards that help you set up the right project for you automatically! With all of the extra functionality, you only need Eclipse to create complex projects of all types. Java development becomes much easier, especially for large projects in a professional environment.
So let’s take a look at how the Eclipse IDE looks so we can explore the text editor and compiler it already has integrated into it!
Take a tour of Eclipse
We will now open Eclipse's handy wizard to start a Java project.
Click on File, then select New, then Java Project. From there Eclipse creates a new project for you! You will see the text editor in the middle where you can type in the code shown below:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("I am using Eclipse!");
}
As you saw in the screencast, Eclipse helped me to type the code by offering suggestions, kind of like predictive text on your phone. Once the text is completed, it automatically gets formatted! On top of that, it puts a red x on the left side telling you if you've made a syntax error. Eclipse compiles your code while you are typing it, which enables it to detect these errors as you write. That's right, it lets you know there's a problem before you even realize it!
Now, from the toolbar click Run and the results will spit out on the Console tab at the bottom of the screen!
See how easy that was? No downloading or updating of extensions, and using separate tools anymore! It is no wonder that large businesses prefer to use Eclipse on their Java development projects. There are even more functionalities that we'll explore, once we get Eclipse downloaded in part two!
Summary
The IDE Eclipse provides superior functionalities, such as a built-in code editor, debugger, and compiler, as well as built-in support for the management of large projects and for sharing projects among teams.
Eclipse provides predictive text and syntax error detection within the editor as you code.