开发者

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

a开发者_如何学编程nt -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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜