Setting up Eclipse and Maven for Java development
This blog post describes how to set up the Eclipse IDE and its Java and Maven dependencies to get started on your Java development. These instructions are specific to Microsoft Windows.
Install Java
The Java Development Kit (JDK) is required.
- Navigate to https://www.oracle.com/java/technologies/downloads/archive/.
- Under "Java SE downloads", click on the latest version. In my case, it was Java SE 23.
- Scroll down and download the Windows x64 Installer. The direct link to this file is: https://download.oracle.com/java/23/archive/jdk-23_windows-x64_bin.exe
- After installation, open the Command Prompt make sure that you are able to invoke Java from the command line (e.g., type
java -version
). If not, you may have to add it to your system path manually.
Download Apache Maven
Maven is used to manage package dependencies. Maven is used to download, import, and reference any dependencies for you, removing the complexity of figuring how where/how to download these dependencies.
- Navigate to https://maven.apache.org/download.cgi.
- Download the binary zip archive (e.g., apache-maven-3.9.6-bin.zip) and extract it to a set folder (e.g., C:\Program Files\apache-maven-3.9.9).
- On Windows 11, click the Start button and search for "edit the system environment variables".
- Click on "Environment Variables".
- Under System variables, click "New" and add a new variable "MVN_HOME" with the value "C:\Program Files\apache-maven-3.9.9".
- Under User variables, double-click on "Path", click on "New" and enter "%MVN_HOME%\bin".
- Make sure that you are able to invoke Maven from the command line (e.g., type
mvn -v
).
Install Eclipse
Eclipse is the development tool of choice (aka IDE). All Java code will be written in Eclipse.
- Navigate to https://www.eclipse.org/downloads/.
- Click on the "Download Packages" link.
- Click on "x86_64" to download the Windows version.
- Click on "Download".
- Double-click and install "eclipse-inst-jre-win64.exe".
- Select "Eclipse IDE for Java Developers".
- It will auto-locate your installation of Java, then click on "INSTALL".