2

I have downloaded and installed maven3.3.3. on uBuntu 14.04 and when I run the command

mvn --version

I get this error

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

I have tries to set the enviroment in /etc/environment

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/apache-maven-3.3.3/bin"

JAVA_HOME="/usr/lib/jvm/java-8-oracle/jre"

MAVEN_OPTS="-Xms1024m -Xmx2048m -Dmaven.surefire.debug=-Xmx2048m -XX:MaxPermSize=128m"

M2_HOME="/opt/apache-maven-3.3.3"

your help will be greatly appreciated

G

3
  • in a terminal or in an IDE?
    – A.B.
    Jul 1, 2015 at 14:04
  • in the terminal @A.B.
    – Gman
    Jul 1, 2015 at 15:58
  • Does my answer?
    – A.B.
    Jul 1, 2015 at 16:20

1 Answer 1

1

In a terminal

./mvn -Dmaven.multiModuleProjectDirectory=$M2_HOME --version

In Eclipse

Window > Preferences > Java > Installed JREs > Edit

Add the line below into Default VM arguments

-Dmaven.multiModuleProjectDirectory=$M2_HOME

Per default, there is nothing to do:

cd
wget http://www.gtlib.gatech.edu/pub/apache/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
tar xf apache-maven-3.3.3-bin.tar.gz
cd apache-maven-3.3.3/bin
./mvn --version

Example output

$ ./mvn --version
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T13:57:37+02:00)
Maven home: /home/aboettger/Downloads/apache-maven-3.3.3
Java version: 1.7.0_79, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-i386/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "linux", version: "3.19.0-21-generic", arch: "i386", family: "unix"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .