Wednesday, August 15, 2012
Wednesday, August 08, 2012
How to set ANT_HOME
1. Install ant and JDK to your system.
2. Set ANT_HOME like below.
Right click on my computer and properties
Click on Advanced System Properties, you will get System Properties popup window.
Click on the Environment Variable.
3. Create a new Variable under System Variables.
Set Name as "ANT_HOME", provide the value. Ex: ANT_HOME=C:\java\ant
4. Create another to set JAVA_HOME under System Variables.
Set Name as "JAVA_HOME", provide the value. Ex: JAVA_HOME=C:\Program Files\Java\jdk1.6.0_20
5. Open a new comand prompt and check whether its set or not by checking thir version
a. To check java -version
C:\Users\eibm155>java -version
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03)
Java HotSpot(TM) Client VM (build 20.8-b03, mixed mode, sharing)
b. To check ant -version
C:\Users\eibm155>ant -version
Apache Ant version 1.8.0RC1 compiled on January 5 2010
Exception: "Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar"
The above exception will surface if the path for jdk is not accessible by the path variable you had set to environment variables.
2. Set ANT_HOME like below.
Right click on my computer and properties
Click on Advanced System Properties, you will get System Properties popup window.
Click on the Environment Variable.
3. Create a new Variable under System Variables.
Set Name as "ANT_HOME", provide the value. Ex: ANT_HOME=C:\java\ant
4. Create another to set JAVA_HOME under System Variables.
Set Name as "JAVA_HOME", provide the value. Ex: JAVA_HOME=C:\Program Files\Java\jdk1.6.0_20
5. Open a new comand prompt and check whether its set or not by checking thir version
a. To check java -version
C:\Users\eibm155>java -version
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03)
Java HotSpot(TM) Client VM (build 20.8-b03, mixed mode, sharing)
b. To check ant -version
C:\Users\eibm155>ant -version
Apache Ant version 1.8.0RC1 compiled on January 5 2010
Exception: "Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar"
The above exception will surface if the path for jdk is not accessible by the path variable you had set to environment variables.
Subscribe to:
Posts (Atom)