简体   繁体   中英

ant Permission Denied problem

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!

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM