Skip to main content

How To Install Maven In Windows 7 64-bit

In today's programming culture it's essential to know some more stuffs apart from the language you code with. I learned the importance of this insight as I was flipping through the book 'Well Grounded Java Developer' . I've come across the title of this book several times only to overlook it meaning  in depth, murmuring 'Ha! another book for java newbie'. But it turned out that I was totally wrong and it taught me a lot about programming (including Java) and other things like test drivent development, build and continuous integration (maven) etc. All these were the buzz terms I've been hearing a lot for the last one year but left unlearned so far. The WGJD was an awesome start-off.

Maven, is one concept I got wrong from the beginning, we've bee using it at our work place as an eclipse plugin for around a year now and I was under the notion that it's 'just a plugin'. Later from the book I understood, maven is a continuous integration tool that's initially run as an application itself via command line and once you get familiar with the cmd usage, you catch up easier with the maven plugins written for IDEs. Below are the ice-breaker steps to get maven running on your windows machine. 

Environment 


  • Operating System : Windows 7 64 bit
  • Java 1.7 installed and path configured in environment variables

Steps To Install Maven In Windows

1. Download the binary (bin) file of maven from : http://maven.apache.org/download.cgi

2. Extract it to C:\

Note: As in many Java/JVM-related software installations, it pays to not
install Maven into a directory with spaces in its name, because you might
get PATH and CLASSPATH errors. For example, if you're using a MS Windows
operating system, don't install Maven into a directory that looks like C:\Program
Files\Maven\.

3. Add the M2_HOME For Windows-based operating systems, you'll add something like this:
M2_HOME=C:\apache-maven-3.0.3

4. Maven needs the Java JDK to run. Any version greater than 1.5 is fine. You'll also need to make sure that your JAVA_HOME environment variable is set—this has probably already been set if you have Java installed. You'll also need to be able to execute Maven-related commands from anywhere in your command line, so you should set the M2_HOME/bin directory to be in your PATH

5. Take the cmd : 

For Windows-based operating systems, you'll need to add this: 

PATH=%PATH%;%M2_HOME%\bin

Note that the above lines have to be entered every time when u start cmd to run maven. The best way is to add the property directly in the PATH field in My Computer (Righ Click) >  Properties> Choose Advanced Tab > Environment Variable.


You can now execute Maven (mvn) with its -version parameter to make sure the basic
install has worked.

mvn -version

Why Should I use Maven ? 

Previously, in java projects, when we required the apis from another framework we used to download the jar files from their respective websites and add it to the lib folder in the java project. This is tiresome process, sometimes your newly downloaded jar will have some dependency and need jar's from some other projects to work well. Maven simply automate the major portion of this task by using a pom.xml file. In the pom.xml file you can just specify the name and version of jar files and maven will fetch the same and it's dependencies from the repository. This is the crux of java but there is a lot more you can do from here. 
You can refer the book Well Grounded Java Developer from Manning to learn more about building your project from the pom.xml and doing several other operations.

Resources 


1. Installing Maven - Mkyong.com
2.  Mavens Official Website

3. The Well Grounded Java Developer  ( affiliate link ) 

Popular posts from this blog

Building Autonomous Drone with Raspberry Pi and APM 2.8

I am a total newbie to hardware and was pushing my limits to see how far I can reach on with hardware projects (which sparked my interest lately). I have set out on a very ambitions mission to control a drone from raspberry pi.I began the research for this around 2 months ago and had brought a raspberry pi, drone body kit and apm flight controller. The key difference of this project from common drone projects is that I'm trying to avoid the use of and RC and instead use the raspberry pi to control it. 


Hardware Installation Setup:
I am using APM 2.8 and Mission Planner.I am using RPi 3 to control the APM 2.8 via Telem port of APMI am planning to power the apm via the battery to ESC (Electronic Speed Controllers)

Now, documenting my steps below:
Day 1Watch TutorialTo get started with APM flight controller, I watched this video tutorial [1] which gives a gentle introduction about APM board. 
Setup APM board and Calibrate SensorsI downloaded the APM Mission Planner software for mac and in…

ICFAI Sikkim Distance MBA Review From My Experience

After a long research I joined for the ICFAI distance MBA program in 2012. Now I've completed 2 semesters ( as of 2013 ). I wanted to write this review so that people who are looking for a good MBA program can get a hand-on review about the distance MBA offered by the ICFAI Sikkim. I've been through all the cycles of this program and this review might help you make the right choice about the program. This article presents my own ( and unbiased ) view of the program and is in no way associated with the course provider.


Is the MBA ICFAI Sikkim Approved By UGC?  As per the latest AICTE regulations, a distance education program must have the approval of a joint commission of  UGC- University Grant CommissionAICTE- All Indian Council for Technical EducationDEC- Distance Education CouncilICFAI Sikkim doesn't have this approval (don't get disappointed, it's not over yet). Only institutes and colleges affiliated to a University are required to take AICTE approval. So ICFAI be…

Is MacBook Air Good For Programming / Blogging ?

I'm a passionate java developer who just migrated from a Windows PC netbook ( Dell mini ) to a 13 inch MacBook Air. Before the netbook I owned a Dell inspirion 1501. I'm quite a bit of an avid blogger as well. I purchased Dell mini just as it was launched hoping that it's compact and mobile architecture would solve all of my need as a programmer and a writer. Unfortunately it turned out that it was a worthless device.The rest of the story goes...



Do Not Compare a Netbook With MacBook AirMacBook's astonishing features far exceeds anything that of a normal Netbook.Before
Buying a netbook for programming and blogging was one of the biggest blunders I ever made on choosing a machine. The screen was 11 inch and clumsy icons of the Windows were a disgrace all the time.The tightly arranged keys in the keyboard made typing a pain. It's slow Intel Atom Processor is too sluggish to run even VLC player.


After  The Mac's backlit spacious keyboard layout, 1440x900 resolution d…