Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
122 views
in Technique[技术] by (71.8m points)

java - Error installing Ant: ANT_HOME is set incorrectly

I read all the possible solutions but the none worked. I downloaded the ant and put it in C:ant (so I have C:antin)

On Windows 7 under System variables I have variable called ANT_HOME with value

C:ant

and variable called PATH with value

%ANT_HOME%in

And when I try in cmd (Command Prompt)

ant -version

I get

ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.

Also, if I try

echo %ANT_HOME%

I get

C:ant

I tried PATH = %PATH%;%ANT_HOME%in but the same situation. Anyone?

EDIT:

Variables are (name - value):

ANT_HOME - C:ant
CLASSPATH - .;C:Program FilesJavajre6libextQTJava.zip
ComSpec - %SystemRoot%system32cmd.exe
FP_NO_HOST_CHECK - NO
JAVA_HOME - C:Program FilesJavajdk1.6.0_23
NUMBER_OF_PROCESSORS - 2
OS - Windows_NT
PATH - %ANT_HOME%in;%JAVA_HOME%in
PATHEXT - .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE - x86
PROCESSOR_IDENTIFIER - x86 Family 6 Model 15 Stepping 6, GenuineIntel
PROCESSOR_LEVEL - 6
PROCESSOR_REVISION - 0f06
PSModulePath - %SystemRoot%system32WindowsPowerShellv1.0Modules
QTJAVA - C:Program FilesJavajre6libextQTJava.zip
TEMP - %SystemRoot%TEMP
TMP - %SystemRoot%TEMP
USERNAME - SYSTEM
windir - %SystemRoot%
XNAGSShared - C:Program FilesCommon FilesMicrosoft SharedXNA
XNAGSv4 - C:Program FilesMicrosoft XNAXNA Game Studiov4.0
Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It sounds like you have it setup right. What happens if you try something like this, which worked for me:

C:>set ANT_HOME=C:apache-ant-1.8.1

C:>set JAVA_HOME=C:jdk1.6.0_24

C:>set PATH=%ANT_HOME%in;%JAVA_HOME%in

C:>ant -version
Apache Ant version 1.8.1 compiled on April 30 2010

This also worked for me by setting up environment variables, like so:

Ant Env


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...