Apache Maven remains one of the most popular dependency managers in the world of Java.
Join the DZone community and get the full member experience.
Join For Free
Apache Maven is distributed in several formats. The simplest way to install Maven is to download a ready-made binary distribution archive and follow the installation instructions. Maven 3.3+ release requires JDK 1.7 or above to execute
General Requirements
- Java JDK must be installed on your system.
- Java 1.7 or higher is needed for Maven.
To verify the Java JDK is properly installed, from your command line, run the following command:
You should see:
This command verifies that the Java complier (javac) is installed.
If javac is not found, check your Java JDK installation. Maven will not function without it properly installed.
Installing Apache Maven on Windows 10
- Download the binary zip archive from a downloaded mirror.
echo %JAVA_HOME%
- Extract the archive to a suitable location.
- Add the directory of the extracted Maven directory to the environment variable. The steps to do so on Windows 10 are:
- Right-click This PC and select Properties.
- On the left pane, select Advance system settings.
- Click the Environment Variables button.
- In the Environment Variables dialog box that appears, double-click Path under System variables.
- In the Edit environment variable dialog box that appears, click the New button.
- Add the path to the bin directory of the Maven installation. An example path is C:apache-maven-3.6.0bin
- Click the OK button.
- Click the OK button to close the Environment Variables dialog box.
- Finally, click the OK button to close System Properties.
- Open a new command prompt window and type the following command.
This command displays the version information. This also verifies that Maven is installed on your computer.
Installing Apache Maven on POSIX Compliant Operating System (Linux and Mac OS X)
To install Maven on a POSIX Compliant Operating System, such as Linux or Mac OS X, perform the following steps:
- Ensure JAVA_HOME is set:
echo $JAVA_HOME
- Download the binary archive from a download mirror.
- Switch the Maven contents.
mv Downloads/apache-maven* /opt/apache-maven
- Add Maven binaries to the PATH and append.
export PATH=/opt/apache-maven-3.6.0/bin:$PATH
- Open a new terminal window and type this command.
mvn -v
This command displays the version information and verifies that Maven is installed on your computer.
Like This Article? Read More From DZone
java ,apache ,maven ,how-to ,setup ,dependency management
Published at DZone with permission of John Thompson , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
I want to create a Tapestry Skeletion Project.I follow to these guide: http://maven.apache.org/download.html#Installation,http://juanjoefe.com/tutoriales/instalar-maven-en-windows-7/and other guides on the internet.
But, when I type 'mvn --version' or 'mvn -version', I always receive error '
mvn
is not recognized as an internal or external command, operable program or batch file.My friends use Windows 7 x86, and they had no problem.How can I install Maven 3.0.3 on Windows 7 x64?
Gia Duong Duc MinhGia Duong Duc Minh61755 gold badges1111 silver badges2828 bronze badges
9 Answers
- navigate in explorer to the Maven directory
- go to a dir IN the bin
- copy the address in the address bar(must end with bin)
- go to Start and type in 'env'
- Select 'edit the system evironment variables'
- find the PATH variable which must also have an existing value for Java as Maven needs Java.
- append a ; + paste the path.
- restart to update system
- run 'mvn install' in the cli.
Yucca
Community♦
thejartenderthejartender5,35166 gold badges2727 silver badges4848 bronze badges
Setting up Maven 3.0.4 in Windows 7 64 bit
Right Click My Computer --> Properties --> Advanced System Properties --> Environment Variables --> System Variables
Click New
Aug 26, 2015 Here are three ways to launch Internet Explorer. First method: Open Start menu, select All Apps. Navigate to Window Accessories. Expand Windows Accessories, select Internet Explorer. If you desire you could right click on Internet Explorer and with Pin to Start or Pin to taskbar if you use IE 11. Jun 10, 2019 New computer, running Windows 8 and Internet Explorer 11, and clicking on links opens up a new window instead of just a new tab. Also opens in a different colour, address bar and tab titles at bottom of screen. Old computer running Windows 7 and Internet Explorer 11 for Windows 7 didn't have this problem. Internet explorer 11 open in new window. Dec 11, 2014 SOLVED How can I make IE 11 open links in new window not new tab? This is a discussion on SOLVED How can I make IE 11 open links in new window not new tab? Within the Internet Explorer & Edge Forum forums, part of the Tech Support Forum category. I have Internet Explorer 11 with Windows 8.1. I can't make links open in a new window instead of a. Ever since Internet Explorer introduced tabbed browsing (IE 7), links that were designed to open a new window now open a new tab instead. But you do have some control over that behavior. To open any link in a new IE window, either right-click on the link and choose ' Open in new window ' from the menu, or hold down the Shift key on your keyboard while you click on a link.
Add
Assuming JAVA_HOME is already setup.
Edit Path environment Variable and add
%M2%
as ;%M2%
at the end of the existing pathexample:
Apply and Close the System Properties
Open a new command prompt and type
mvn --version
Following will be the message,
Arun B ChandrasekaranArun B Chandrasekaran
I had the same issue but was able to fix it.
When I set up
maven_home
, I had a semi-colon ;
at the end. So when I set up path it become MAVEN;bin ..
. I removed the semi-colon ;
at the end and problem solved.For some reason the
;
does not matter in Windows XP, but is a problem in Windows7 (32 bit).Nathan
Leigh27.8k77 gold badges4646 silver badges9090 bronze badges
nathan vonathan vo
You can also have multiple Maven installations in your PATH like I do:
The first Maven bin (Maven 3), is used before my previous (Maven 2).
thejartenderthejartender5,35166 gold badges2727 silver badges4848 bronze badges
You must add the directory containing the mvn executable to your PATH environment variable.
thejartender5,35166 gold badges2727 silver badges4848 bronze badges
BuhbBuhb5,93533 gold badges1919 silver badges3434 bronze badges
Windows sort all variables by alphabet. Don't use multiple elements to construct path to maven like M2 for folder /bin and M2_HOME for root folder JUST take full path to bin directory of maven and put it in the Path variable
zestzest5,63533 gold badges2424 silver badges3434 bronze badges
- Just set the system environment variable rather than user variable
- set the M2_HOME as: C:Program Filesapache-maven-3.1.1 rather than : C:Program FilesApache Software Foundationapache-maven-3.1.1 (I don't know why, but it seems that the space really matters!)
48333 gold badges1010 silver badges3030 bronze badges
I faced with this problem when use maven 3.3.3. Then tried with maven 3.3.9, it worked! Solution is download new version of maven.
PhuongPhuong
Solved my issue by doing the following:
- As per Maven [Install] section page, It says: 'Extract distribution archive in any directory'. So extracted files in G: drive and hence this was the cause root.
- Shifted the downloaded folder to C: drive solved my issue
- Updated environment variables. Closed and re-open the command prompt.
Maven Window
Moshe Slavin3,07755 gold badges1212 silver badges3030 bronze badges
SuketaSuketa
protected by Community♦Nov 2 '12 at 11:50
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
Would you like to answer one of these unanswered questions instead?
Not the answer you're looking for? Browse other questions tagged javamaven-3tapestry or ask your own question.
Maven is a Java based tool, so the very first requirement is to have JDK installed on your machine.
System Requirement
JDK | 1.7 or above. |
---|---|
Memory | No minimum requirement. |
Disk Space | No minimum requirement. |
Operating System | No minimum requirement. |
Step 1 - Verify Java Installation on your Machine
Open console and execute the following java command.
OS | Task | Command |
---|---|---|
Windows | Open Command Console | c:> java -version |
Linux | Open Command Terminal | $ java -version |
Mac | Open Terminal | machine:~ joseph$ java -version |
Let's verify the output for all the operating systems −
OS | Output |
---|---|
Windows | java version '1.7.0_60' Java(TM) SE Runtime Environment (build 1.7.0_60-b19) Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode) |
Linux | java version '1.7.0_60' Java(TM) SE Runtime Environment (build 1.7.0_60-b19) Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode) |
Mac | java version '1.7.0_60' Java(TM) SE Runtime Environment (build 1.7.0_60-b19) Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode) |
If you do not have Java installed, install the Java Software Development Kit (SDK) from https://www.oracle.com/technetwork/java/javase/downloads/index.html. We are assuming Java 1.7.0.60 as installed version for this tutorial.
Step 2 - Set JAVA Environment
Set the JAVA_HOME environment variable to point to the base directory location where Java is installed on your machine. For example −
OS | Output |
---|---|
Windows | Set the environment variable JAVA_HOME to C:Program FilesJavajdk1.7.0_60 |
Linux | export JAVA_HOME=/usr/local/java-current |
Mac | export JAVA_HOME=/Library/Java/Home |
Append Java compiler location to System Path.
OS | Output |
---|---|
Windows | Append the string “;C:Program FilesJavajdk1.7.0.60bin” to the end of the system variable, Path. |
Linux | export PATH=$PATH:$JAVA_HOME/bin/ |
Mac | not required |
Verify Java Installation using java -version command as explained above.
Step 3 - Download Maven Archive
Download Maven 2.2.1 from https://maven.apache.org/download.cgi.
OS | Archive name |
---|---|
Windows | apache-maven-3.3.1-bin.zip |
Linux | apache-maven-3.3.1-bin.tar.gz |
Mac | apache-maven-3.3.1-bin.tar.gz |
Step 4 - Extract the Maven Archive
Extract the archive, to the directory you wish to install Maven 3.3.1. The subdirectory apache-maven-3.3.1 will be created from the archive.
OS | Location (can be different based on your installation) |
---|---|
Windows | C:Program FilesApache Software Foundationapache-maven-3.3.1 |
Linux | /usr/local/apache-maven |
Mac | /usr/local/apache-maven |
Step 5 - Set Maven Environment Variables
Add M2_HOME, M2, MAVEN_OPTS to environment variables.
OS | Output |
---|---|
Windows | Set the environment variables using system properties. M2_HOME=C:Program FilesApache Software Foundationapache-maven-3.3.1 M2=%M2_HOME%bin MAVEN_OPTS=-Xms256m -Xmx512m |
Linux | Open command terminal and set environment variables. export M2_HOME=/usr/local/apache-maven/apache-maven-3.3.1 export M2=$M2_HOME/bin export MAVEN_OPTS=-Xms256m -Xmx512m |
Mac | Open command terminal and set environment variables. export M2_HOME=/usr/local/apache-maven/apache-maven-3.3.1 export M2=$M2_HOME/bin export MAVEN_OPTS=-Xms256m -Xmx512m |
Step 6 - Add Maven bin Directory Location to System Path
Now append M2 variable to System Path.
OS | Output |
---|---|
Windows | Append the string ;%M2% to the end of the system variable, Path. |
Linux | export PATH=$M2:$PATH |
Mac | export PATH=$M2:$PATH |
Step 7 - Verify Maven Installation
Now open console and execute the following mvn command.
OS | Task | Command |
---|---|---|
Windows | Open Command Console | c:> mvn --version |
Linux | Open Command Terminal | $ mvn --version |
Mac | Open Terminal | machine:~ joseph$ mvn --version |
Finally, verify the output of the above commands, which should be as follows −
OS | Output |
---|---|
Windows | Apache Maven 3.3.1 (r801777; 2009-08-07 00:46:01+0530) Java version: 1.7.0_60 Java home: C:Program FilesJavajdk1.7.0_60 jre |
Linux | Apache Maven 3.3.1 (r801777; 2009-08-07 00:46:01+0530) Java version: 1.7.0_60 Java home: C:Program FilesJavajdk1.7.0_60 jre |
Mac | Apache Maven 3.3.1 (r801777; 2009-08-07 00:46:01+0530) Muviza lagu mp3 video mp4 3gp free download. Java version: 1.7.0_60 Java home: C:Program FilesJavajdk1.7.0_60 jre |
- [Voiceover] Now that we have the Maven…file downloaded and extracted into…our program files directory,…we can go ahead and install…Maven on our Windows machine.…As I stated earlier,…the Maven download is not very large.…That's because Maven's power is included in…its plugins which are located and retrieved…from a central repository on an as-needed basis…and allowing for greater code reuse.…Before the installation we must verify…our Java version from the command line…using java -version.…
Install Maven On Windows 10 Pc
Remember it must be 1.7 or higher.…I'm going to open up a command window.…I'm going to type cmd and hit enter.…Now, I'm going to type,…java -version…and hit enter.…The version on my machine is 1.8.0_91.…That's higher than 1.7, so I'm good to go.…To make life easier,…we need to update our environment variables.…We can do that using either the command window,…but, if you use the command window…you're going to have to update them every time,…or, we can go to the control panel.…
Clean Install Maven On Windows 10
For now, let's use the control panel.…I'm going to go back to start again…