I am trying to setup a path variable for my maven installation. The system information is like:
[user1@machine1]~% whereis maven
maven: /etc/maven
[user1@machine1]~% cd /etc/maven
[user1@machine1]/etc/maven% ls
maven2-depmap.xml
should I setup path like
export MAVEN_HOME=/home/user1/etc/maven/
But based on ls
command, it seems that there does not exist the binary maven file except maven2-depmap.xml
under /etc/maven/
3) Add Maven Path in environment variable Click on new tab if path is not set, then set the path of maven. If it is set, edit the path and append the path of maven. Here, we have installed JDK and its path is set by default, so we are going to append the path of maven. The path of maven should be %maven home%/bin.
Add Maven support Open an existing project, for example, a Java project. In the Project tool window, right-click your project and select Add Framework Support. In the dialog that opens, select Maven from the options on the left and click OK.
The command is named mvn
. I have no idea what /etc/maven
would be, it seems like some crazed Linux distro person's idea of a joke; it certainly isn't a maven home.
Please download an ordinary tarball of maven from maven.apache.org, and unpack it in /opt
. You don't have to set MAVEN_HOME
, just put /opt/apache-maven-whatever/bin
in your path.
Here it is, just change path to you downloads...
# set Java, Maven and Hadoop:
JAVA_HOME="/usr/lib/java-7-oracle/jdk1.7.0_45"
export JAVA_HOME
set PATH="$PATH:$JAVA_HOME/bin"
MAVEN_HOME="/home/YOUR_NAME/Downloads/apache-maven-3.1.1"
export MAVEN_HOME
PATH=$PATH:$MAVEN_HOME/bin
HADOOP_HOME="/home/YOUR_NAME/Downloads/hadoop-1.2.1"
export HADOOP_HOME
PATH=$PATH:$HADOOP_HOME/bin
export PATH
export M2_HOME=Maven
installed location
export PATH=${M2_HOME}/bin:${PATH}
Add both the line in sudo vi /etc/profile.d/maven.sh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With