IDE sets the classpath automatically

As we already mentioned, the javac and java tools know where to find the standard libraries that come with the JDK installation. If your code uses other libraries, you need to tell IDE which libraries you need, so IDE can find them and set the classpath.

To accomplish that, IDE uses a dependency-managing tool. The most popular dependency-managing tools today are Maven and Gradle. Since Maven has been around longer than Gradle, all major IDEs have this tool, either built-in or integrated via a plug-in. A plug-in is a piece of software that can be added to an application (IDE, in this case) to extend its functionality.

Maven has an extensive online repository that stores practically all existing libraries and frameworks.  To tell an IDE with a built-in Maven capability which third-party libraries your application needs, you have to identify them in the file called pom.xml. IDE reads what you need from the pom.xml file and downloads the required libraries from the Maven repository to your computer. Then, IDE can list them on the classpath while executing the javac or java command. We will show you how to write pom.xml content in Chapter 4Your First Java Project

Now is the time to choose your IDE, install it, and configure it. In the next section, we will describe the most popular IDEs.