How to Install Maven on Windows 11

To install Maven on Windows 11, install a Java JDK, download the Apache Maven binary zip from maven.apache.org, extract it to a permanent folder, add that folder’s bin directory to your PATH, then open a new Command Prompt and run mvn -v.

A build script for a school or work project says “‘mvn’ is not recognized”, and you need Maven working on a Windows 11 PC that already has (or still needs) a Java JDK.

What Maven Does

Apache Maven is a build tool for Java projects. It reads a project’s pom.xml file, downloads the libraries the project depends on and runs the build. Maven isn’t a Windows app with an installer: it’s a folder of files that you unpack and point Windows at.

Maven needs a Java Development Kit (JDK), not just a Java runtime. The Apache Maven installation page says you either set the JAVA_HOME environment variable to the folder where the JDK is installed, or have the java executable on your PATH. The version you need depends on the Maven line you install:

Maven release lineMinimum JDK (per the Maven download page)Status on the download page
3.10.xJDK 8 or newerLatest release, recommended for all users
3.9.xJDK 8 or newerPrevious stable release
4.xJDK 17 or newerPreview release candidate, not safe for production

To see whether a JDK is already installed, open Command Prompt and type java -version. If you get a version number, note it. If Windows says java isn’t recognized, install a JDK first. The steps for that are in installing Java on Windows 11, and Microsoft’s own build is described on its Microsoft Build of OpenJDK install page. One detail matters for Maven: Microsoft says its EXE installer doesn’t set JAVA_HOME by default (Microsoft lists it as an optional installer feature, FeatureJavaHome, that isn’t selected by default), and the ZIP version leaves JAVA_HOME entirely up to you.

You’ll also edit environment variables. Changing the System variables list normally needs an administrator account; your own User variables can usually be edited without admin rights.

Download the Maven Binary Zip

  1. Open the Apache Maven download page in your browser.
  2. Find the row for the Binary zip archive. As of November 2026 the page lists Maven 3.10.0 as the latest release, so the file is named apache-maven-3.10.0-bin.zip. Pick the 3.x release the page recommends rather than a Maven 4 release candidate.
Apache Maven download table showing the binary ZIP archive for Maven 3.10.0
Choose the binary ZIP archive on the Apache Maven download page. Version numbers change over time.
  1. Click the file link to download it. Skip the “src” archive: that’s the source code, not the ready-to-run program.

Optional but worthwhile on a work machine: each file on the download page has matching .sha512 (checksum) and .asc (signature) links, and Apache highly recommends verifying the signature against the KEYS file published by the Maven developers so you know the zip wasn’t altered.

Extract Maven to a Permanent Folder

Apache says the archive can be extracted to any directory. Choose a place you won’t clean out later, because Windows will run Maven from wherever you put it.

  1. Open File Explorer and go to your Downloads folder.
  2. Right-click apache-maven-3.10.0-bin.zip and choose Extract All.
  3. Set the destination to a folder such as C:\tools and click Extract. You’ll end up with C:\tools\apache-maven-3.10.0, which contains the bin folder you’ll add to PATH.

Two tips. Maven’s Windows prerequisites page warns not to unpack it in the middle of your source code, so keep it away from project folders. And while C:\Program Files works, a short path without spaces (like C:\tools) is easier to type and avoids quoting trouble in older build scripts. That second point is practical advice, not an Apache rule.

Add Maven’s bin Folder to PATH

PATH is the list of folders Windows searches when you type a command. Adding Maven’s bin folder is the one environment change Apache’s install page requires. If you haven’t used the Environment Variables window before, opening environment variables in Windows 11 walks through the ways in.

  1. Click Start, type environment variables and select Edit the system environment variables (on most Windows 11 PCs this opens System Properties on the Advanced tab).
  2. Click Environment Variables.
  3. Under System variables (or under your user variables if you aren’t an administrator), select Path and click Edit.
  4. Click New and enter the full path to the bin folder, for example C:\tools\apache-maven-3.10.0\bin.
Windows Path editor with an example Apache Maven bin folder
Example Maven installation path. Use the folder for your installed version. (Recreated interface)
  1. Click OK in each open window to save.

System variables apply to every account on the PC; user variables apply only to you. Either works for Maven as long as you add the bin folder itself, not the parent folder.

Set JAVA_HOME If Maven Can’t Find Java

If java -version already works, Maven can usually find Java through PATH. Some project scripts and IDEs look for JAVA_HOME, though, so setting it can save trouble later.

  1. In File Explorer, find the JDK folder, for example a folder under C:\Program Files that holds bin and lib folders. Copy its path from the address bar.
  2. In the Environment Variables window, click New under System variables (or user variables).
  3. Enter JAVA_HOME as the variable name and paste the JDK folder as the value. Use the JDK’s main folder, not its bin subfolder.
New User Variable dialog with JAVA_HOME pointing to an example JDK 21 folder
Example JDK 21 path. Use your actual JDK installation folder. (Recreated interface)
  1. Click OK to save.

You don’t need MAVEN_HOME or M2_HOME. Older tutorials made both mandatory, but Apache’s current install steps only add the bin folder to PATH. Set one only if a specific tool or script asks for it.

Check the Install With mvn -v

Environment changes only reach programs started after you save them, so close any Command Prompt or terminal that was already open. Apache’s instructions say to confirm in a new shell; a full restart isn’t needed.

  1. Open a new Command Prompt. If you need a refresher, see the ways to open Command Prompt in Windows 11.
  2. Type mvn -v and press Enter.
Guide to the Maven version, Maven home, and Java version fields in mvn -v output
Output guide. The version check shows which Maven installation and Java runtime are running.

A working install prints the Maven version, the Maven home folder, the Java version and Java home folder Maven is using, and your Windows details. Check that “Maven home” points to the folder you extracted and that the Java version meets the minimum in the table above. If a project uses a newer Java than Maven picked up, fix JAVA_HOME so it points at the right JDK.

Install With Chocolatey or Scoop Instead

If you already use a Windows package manager, Apache’s install page lists two commands that install Maven for you (package managers typically take care of PATH as well):

  • Chocolatey: choco install maven
  • Scoop: scoop install main/maven

You still need a JDK, and you still confirm with mvn -v in a new window. Pick one route per PC: mixing a manual install with a package manager install leaves two Maven folders on PATH, and whichever comes first wins.

Fix “mvn Is Not Recognized” and JAVA_HOME Errors

‘mvn’ is not recognized as an internal or external command. Windows can’t find mvn.cmd. Check these in order:

  1. You opened a new Command Prompt after saving PATH. Old windows keep the old PATH.
  2. The PATH entry ends in \bin and the folder really contains mvn.cmd. A common slip is adding C:\tools\apache-maven-3.10.0 without \bin, or extracting into a nested folder such as C:\tools\apache-maven-3.10.0\apache-maven-3.10.0.
  3. There’s no typo, stray space or quote mark in the entry.

A message that JAVA_HOME is not defined correctly. Maven found a JAVA_HOME variable but it points at the wrong place. Type echo %JAVA_HOME% in Command Prompt. The result should be the JDK’s main folder (not \bin, not a runtime-only folder, and not a JDK you’ve since uninstalled). Correct it, open a new window and run mvn -v again.

The build starts but can’t download anything. Maven’s Windows prerequisites page notes that a firewall or antivirus program may need an exception so Maven can reach the internet. On a work network, ask IT whether a proxy is required.

Update or Remove Maven Later

To update a manual install, download and extract the newer zip next to the old one, change the PATH entry to the new bin folder, open a new window and run mvn -v. Once the new version works, delete the old folder. To remove Maven entirely, delete its PATH entry (and MAVEN_HOME or M2_HOME if you created them), then delete the folder. Package manager installs should be updated or removed with the same package manager.

Maven Setup Questions

Is Maven 4 ready to install?

Not for regular project work. The download page labels the Maven 4 release candidate a preview that is not safe for production use, and it needs JDK 17 or newer. Use the recommended 3.x release unless a project tells you otherwise.

Do I have to run Command Prompt as administrator?

No. Maven runs fine from a normal window. Admin rights matter only for editing System variables or for package managers that install into protected folders. If one of those asks for elevation, use Command Prompt as an administrator.

Why does mvn work in one terminal but not in my IDE?

Programs that were open when you changed PATH keep the old values. Close and reopen the IDE. Some IDEs bundle their own copy of Maven or have a setting for which Maven folder to use, so check the IDE’s Maven settings if it still shows a different version.

Can I keep two Maven versions?

Yes. Extract each to its own folder and keep only one bin folder on PATH. To switch, edit the PATH entry and open a new window.

Once mvn -v prints both versions cleanly, go back to the project folder that failed and run its build command again.