問題描述
Apache Ant Build 命令“拒絕訪問” (Apache Ant Build command "Access Denied")
Hey! I am trying to get ant installed and actually already did following this instructions however, I get this error:
Buildfile: build.xml does not exist!
Build failed
which it says there I might get so I just tried executing the next command it says I should(since I'm under Windows it's this one):
build ‑Ddist.dir=<C:\Ant> dist
anyway I get "access denied" when hitting enter and I can't figure out why. I also tried
build install
and
build install‑lite
but I always get that message =/ any ideas why? or what am I doing wrong?
Edit
Without the < > I get a:
'build' is not recognized as an internal or external command, operable program or batch file.
Edit2 Well, my ANT_HOME is in C:\Ant and I'm trying to run the command while placing myself on that folder, isn't that correct?
‑‑‑‑‑
參考解法
方法 1:
You are taking the < and > symbols too literally. Take them off.
Kind of like C:\Users\<Your ID>
the symbols are placeholders.
Are you in the right directory? Do you have something else called build in your path that may be superceeding the build you are trying to call. Can you create a file in that directory?
PROMPT> copy con foo.txt
asdf
asdf
sdf
CONTROL‑D
方法 2:
Ant is already installed correctly if you're getting this:
Buildfile: build.xml does not exist!
Build failed
The "build" commands you tried next are only for building Ant from source. You don't need to do this, since Ant is already installed.
In general, the "'XXXX' is not recognized..." means XXXX is not a command/executable, or that it's not on your PATH.
方法 3:
Not sure if this helps but the first question that comes to mind is "do you have appropriate permissions on the file"?
(by Tsundoku、ojblass、rkb、Ankur)