How can I easily set ANT_HOME under Windows? I added "D:\Installz\apache-ant-1.8.2\bin;" to my system environment variable PATH and I also created an ANT_HOME variable.
相关问题
- Inheritance impossible in Windows Runtime Componen
- how to get running process information in java?
- Is TWebBrowser dependant on IE version?
- How can I have a python script safely exit itself?
- I want to trace logs using a Macro multi parameter
相关文章
- 如何让cmd.exe 执行 UNICODE 文本格式的批处理?
- 怎么把Windows开机按钮通过修改注册表指向我自己的程序
- Warning : HTML 1300 Navigation occured?
- Bundling the Windows Mono runtime with an applicat
- Windows 8.1 How to fix this obsolete code?
- CosmosDB emulator can't start since port is al
- How to print to stdout from Python script with .py
- Determine if an executable (or library) is 32 -or
In Windows 7 you can go to
Control Panel\All Control Panel Items\System
or right click on Computer and then to“Advance system setting”
D:\Installz\apache-ant-1.8.2
)Either click again on New button if you do not have ‘Path’ Variable in there
OR
Select it and edit by adding the value :
%ANT_HOME%\bin;
ant -version
ANT_HOME is the path to your ant installation dir, in your case "D:\Installz\apache-ant-1.8.2" and JAVA_HOME is java install dir e.g. "C:\Program Files\Java\jdk1.7.0", that's on my machine
On Windows, %% (percent) symbols are used to signify variables.
so to set both variables you can do either
in command prompt, only valid for the session of the particular command propmt
or go to System Properties -> Advanced -> Environment Variables and set to new variables
A more flexible solution is to do all that 'environment stuff' in a batch file that starts your ant script, works also when there are no rights to change the environment variables.
See a similar question that came up recently for details.
I had a similar problem of installing JAVA JDK & ANT.
I tried installing JDK this way.
Oracle site --> download JDK setup --> double click on the set up file (on your desktop) --> accept all defaults --> finish.
we need to set environment variable in the deployment system. mycomputer (right click) --> properties --> advanced settings --> Environment variable --> system variable --> add new --> variable name: JAVA_HOME, Variable path: installation path of jdk on you computer --> click ok, ok.
To check the successful installation of Java . windows + R --> cmd --> Java -Version you would see the response as below
C:\Users\PRAX>java -version java version "1.6.0_38" Java(TM) SE Runtime Environment (build 1.6.0_38-b05) Java HotSpot(TM) 64-Bit Server VM (build 20.13-b02, mixed mode)
This shows that you have successfully installed JDK & set an environment variable too.
ANT installation:
download ant file from http://ant.apache.org/bindownload.cgi choose a mirror & download the zip (zip is the easiest method to set)
unzip the file on your computer --> copy the path (traverse till bin folder).
Now, we need to set an environment variable, Cmd --> set ANT_HOME = installation path --> press Enter if you have correctly entered, it wont throw any error. now execute, echo %ANT_HOME% you would see the result as your installation path.
your work is done.
you can check the environment variable even in computer properties by default after executing the above set up.
Hope, its useful.
I expect you to be running on Windows (since you are using
%
). Simply add a new environment variable (Right-click on My Computer > Properties > Advanced > environment Variable) or usingSET ANT_HOME=<path>
using command line (in that cas, it will only be active on that command line).Once set you should be able to verify its value by doing
echo %ANT_HOME%
in command lineThe % sign around the variable indicates it is an environment variable.
For linux use the
export ANT_HOME=<path>
in command line or in your ~/.profile (persistent, require logout/login). Useecho $ANT_HOME
for verification.