Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven: bash mvn permission denied

This is what I'm seeing:

mvn
bash: /usr/local/apache-maven/apache-maven-3.1.1/bin/mvn: Permission denied

my bash file:

if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi

# User specific aliases and functions

JAVA_HOME=/usr/java/default
export JAVA_HOME

HADOOP_HOME=/usr/share/491s14/hadoop
export HADOOP_HOME

PATH=$PATH:$HOME/bin:$HADOOP_HOME/bin   
export PATH

export M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1
export M2=$M2_HOME/bin
PATH=$M2:$PATH

ls command:

ls -l /usr/local/apache-maven/apache-maven-3.1.1/bin/mvn
-rw-r--r--. 1 root root 5806 Feb 21 11:33 /usr/local/apache-maven/apache-maven-3.1.1/bin/mvn

file command:

file /usr/local/apache-maven/apache-maven-3.1.1/bin/mvn
/usr/local/apache-maven/apache-maven-3.1.1/bin/mvn: POSIX shell script text executable
like image 612
rcj Avatar asked Feb 21 '14 17:02

rcj


2 Answers

Your permission shows that you can't execute that file. Modify permissions for that file. If you want all the users in the machine should be able to execute that file, then do this :

chmod a+x /usr/local/apache-maven/apache-maven-3.1.1/bin/mvn
like image 96
iamauser Avatar answered Nov 18 '22 01:11

iamauser


/usr/local/apache-maven/apache-maven-3.1.1/bin/mvn does not have the execute permission. This should be able to fix it:

chmod a+x /usr/local/apache-maven/apache-maven-3.1.1/bin/mvn
like image 3
Lee Duhem Avatar answered Nov 18 '22 00:11

Lee Duhem