ant Permission Denied problem

15,249

If you own the file, try

chmod u+x /path/opt/apache-ant-1.8.2/bin/ant

If someone else owns it, either sudo or become root then

chmod 755 /path/opt/apache-ant-1.8.2/bin/ant

You need to have execute permissions on the file; the first gives execute permissions to the owner only and is probably preferable if you own the file and are the only one that uses it. The second requires root privileges and gives execute and read permission to everyone, plus write permission to the owner.

You can view the current permissions and ownership of the file by running ls -l /path/opt/apache-ant-1.8.2/bin/ant.

Share:
15,249
algorithmicCoder
Author by

algorithmicCoder

Updated on July 10, 2022

Comments

  • algorithmicCoder
    algorithmicCoder almost 2 years

    After extracting and saving the ant files into an opt/ directory and setting the path variable to $ANT_HOME/bin

    I ran the following command on a CentOS 5

    ant -version
    

    and I am getting the following error

    -bash:/path/opt/apache-ant-1.8.2/bin/ant: Permission denied
    

    Is there some permission I am supposed to set or some typical source of this problem?

    Thanks!