Setting up Eclipse and Maven for Java development

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.

  1. Navigate to https://www.oracle.com/java/technologies/downloads/archive/.
  2. Under "Java SE downloads", click on the latest version. In my case, it was Java SE 23.
  3. 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
  4. 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.

  1. Navigate to https://maven.apache.org/download.cgi.
  2. 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).
  3. On Windows 11, click the Start button and search for "edit the system environment variables".
  4. Click on "Environment Variables".
  5. Under System variables, click "New" and add a new variable "MVN_HOME" with the value "C:\Program Files\apache-maven-3.9.9".
  6. Under User variables, double-click on "Path", click on "New" and enter "%MVN_HOME%\bin".
  7. 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.

  1. Navigate to https://www.eclipse.org/downloads/.
  2. Click on the "Download Packages" link.
  3. Click on "x86_64" to download the Windows version.
  4. Click on "Download".
  5. Double-click and install "eclipse-inst-jre-win64.exe".
  6. Select "Eclipse IDE for Java Developers".
  7. It will auto-locate your installation of Java, then click on "INSTALL".