Search code examples
javamacosmaven

Dmaven.multiModuleProjectDirectory system property is not set


1) Downloaded maven. 2) tar xzvf apache-maven-3.3.9-bin.tar.gz 3) I tried to install maven 3.3.9 on my Mac and when I check the "mvn --version" it says

-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match

4) My bash_profile looks like export M2_HOME=/Users/vijay/Documents/Softwares/apache-maven-3.3.9 export PATH=$PATH:$M2_HOME/bin MAVEN_OPTS="-Xmx4096m" export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home

Can anyone suggest to resolve it and get the maven installed corectly on my Mac


Solution

  • set environment variables like :

    export M2_HOME=/Users/vijay/Documents/Softwares/apache-maven-3.3.9

    export M2=$M2_HOME/bin

    export MAVEN_OPTS=-Xmx4096m

    export PATH=$M2:$PATH