I am trying to install maven 2.2.1 in redhat6
I have downloaded maven file `openlogic-maven-2.2.1-all-bin-1.zip` extracted in folder called maven. after extraction I get a folder called `maven-2.2.1` .This is the path where I have extracted maven `/home/qaserver/app/maven`.

After that I set home path for maven in `.bash_profile`.
this is the content of `.bash_profile`

```html
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

JAVA_HOME=/home/qaserver/app/java/jdk1.6.0_45
export JAVA_HOME

M2_HOME=/home/qaserver/app/maven/maven-2.2.1
export M2_HOME

PATH=$M2/bin:$JAVA_HOME/bin:$PATH
export PATH
```

after setting the home path when I run `mvn -version` I get `bash: mvn: command not found`

I have set install java same way, but my maven is not working where as when I type java -version. I get this

`java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)`

1. Is there any thing wrong in `.bash_profile` ?
2. one more problem I am facing that I need to run .bash\_profile every
time when ever I restsrt my system or open any new terminal to run
java -version

I don't want to install maven using command.because I need to configure java and maven now and then maximum time. Thats why I want to keep the installation process simple, so that I can change it easily