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 ) 

Comments

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 Ins tallation 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 APM I am planning to power the apm via the battery to ESC (Electronic Speed Controllers) Now, documenting my steps below: Day 1 Watch Tutorial To 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 Sensors I downloaded the APM Missi

Hadoop The Definitive Guide [Book] - Study Notes

Chap-1- Meet Hadoop Requirement and adoption in yahoo. A framework that can scale to the web. Map and Reduce acitivity and features like data locality. Can be applied with a variety of algorithms Huge data processing can beat good algorithms Chap-2 - MapReduce The Map Java class and Reducer Java class The Job java class Jobtracker and tasktracker Hadoop reduces the input to input splits or just splits Map tasks write the intermediate output to local disks, so that they can be discarded after use. Outputs of Reduce tasks are stored in HDFS Combiner function can be run on map output, and the combiner functions output forms the input to the reduce function Hadoop streaming proivide hadoop apis in languages other than Java Chap-3 - The Hadoop Distributed Filesystem Fault tolerant solution. Same data written at multiple places. Filesystems that manage the storage across a network of machines are called distributed filesystems. Blocks - a block size is the minim

Adafruit GFX - How to change line spacing in text?

  You may want to update the line spacing to be a little lower than default due to small screen size on IoT devices. I faced this challenge while working on a Watchy hobby project. You may have used a font generator or just using the default fonts and got a *.h file that has the details of the font. In that case just change the last integer value in the PROGMEM variable.