I'm about to work through a book, "Flex on Java" and it's asked me to install maven 2+ i downloaded maven from the apache site. Added :
M2_HOME = C:\apache-maven-2.2.1
and
M2 = %M2_HOME%\bin
to the environment vars according to the instructions at http://maven.apache.org/download.html
then it gets to number 6 which says
"In the same dialog, update/create the Path environment variable in the user variables and prepend the value %M2%
to add Maven available in the command line."
Which environment variable should i edit and add %M2%
to?
After googling i found a post which says "append", not prepend to the value of JAVA_HOME
I've tried prepending and appending it to the java home var but when i try to do
an mvn command from the command line it says its not recognised.
Never used maven before so this is my first set up. Can anyone see what i'm not doing right or what else i need to do to be able to use the mvn command, please and thank you.
Visit the Maven download page and select the version of Maven you want to install. The latest version is listed in the Files section, and you can access earlier versions by using the archive link in the Previous Releases section. We are using version 3.8.
Once Maven is installed, you can check the version by running mvn -v from the command-line. If Maven has been installed, you should see something resembling the following output. If you see this output, you know that Maven is available and ready to be used.
The environment variable you should edit is path
.
The route on Windows 7 is:
Control Panel -> System -> Advanced system settings -> Advanced Tab -> Environment Variables -> The path
variable is right on the system variables area
The path
variable specifies a group of directories and/or paths that Windows searches for commands definitions. You should append to the end of this variable value the value ;%M2%
(note the semi-colon, different paths should be separated by them) in order for Windows to be able to find the Maven command definitions.
Appending ;%M2
at the end of the path environment variables is the same as appending ;C:\apache-maven-2.2.1\bin
To test that everything is ok, type mvn --version
, if everything is right then the current Maven version you're using should be displayed on the screen.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With