Skip to main content

OSX Yosemite : how to install maven ? (updated)

Hello,

Today we are going to install maven to my MacBook Pro (late 2010 model). It has OS X Yosemite. Before you start please install JDK. I have installed jdk-8u45-macosx-x64

Lets start :


- First you need to install latest version of maven from its website.here is the link : https://maven.apache.org/download.cgi

- When you open the web site scroll the page down. You will see this caption.
"Unix-Based Operating Systems (Linux, Solaris and Mac OS X)" 
Follow the instructions and install. You can think what is the aim of this post 
but don't have a hasty judge on me because these instructions didn't work 
on my OS so I decided to publish this post. As they write in instructions 
download apache-maven-3.3.3-bin.tar.gz


After end of download double click to ".tar" file

- Now we need to locate the "apache-maven-3.3.3" folder. Copy the folder. I prefer to locate

 folder in Library folder. on when you are on desktop press Shift + Command + C button combination to open Computer. There you are going to see the HDD which is OS installed.
Double click on OS disk and then Library Folder. Then paste the folder inside Library folder.
Location of folder.

- If you finished to locate folder. Now you need to point it to your operating system. on Yosemite press Command+Space and write "Terminal" to spotlight search.


Click the Terminal to run.

- On command line write this command and press enter. open ~/.bash_profile

After you press enter the .bash_profile will be open in text edit. You will edit this file to point where your Java and Maven are.
- If you open .bash_profile file enter the following lines to file. according to your system configuration file paths can change.

export M2_HOME=/Library/apache-maven-3.3.3/
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
export JAVA_HOME=$(/Library/Java/JavaVirtualMachines/jdk1.8.0_45)

- press command + S and save file then close text edit window. Also you need to quit from Terminal to do this when you are in Terminal press command+Q and it will be closed. Then re-open Terminal and enter this command mvn --version if you have the following screen your installation is completed success fully.


Proof of successful installation.
AFTER ALL IF YOU HAVE PROBLEM WITH INSTALLATION EDIT JAVA HOME LINE IN .BASH_PROFILE FILE SAME AS BELOW

export JAVA_HOME=$(/usr/libexec/java_home)

Comments

Popular posts from this blog

net-snmp : step by step installation, (Windows 7 X64, x86) (32bit & 64bit)

Hello, I'm going to show you how to download and install net-snmp service to enable SNMPv3 for windows 7 64bit because windows operating systems don't support it. With version 3 SNMP has new security options to make package transfer safe. wikipedia SNMP v3 There is 32 bit versions for all setup files. installation steps are same. installation :    visual C++ 2008 redistributable package (x64) before all you need to install this because as you will see the openssl (if you want to use net-snmp with snmpv3 you are going to need this) installation needs this. Download Page Link :  Visual C++ 2008 redistributable installation When you click the link above you will see this screen check the version. if it is x64 then click download button. Microsoft Download Center web page. Select download location.   Then double click  vcredist_x64.exe  and start setup. Finish the installation. Win64 OpenSSL v0.9.8zf  if you want to use snmpv3 functionality with net-