Search This Blog

Monday, June 8, 2015

How to set java path and Ant tool path

Java Path
step 1:Open the folder where java is installed and copy the url till bin folder.
Go through the image for reference.

step 2: Now right click on Computer --> properties --> Advanced system settings --> Environment Variables --> new -->
Enter variable name as "JAVA_HOME" and in variable value, paste the java url which you copied. and then click ok.
see the below image for reference

step 3 : clcik on new button and then enter variable value as "PATH" and variable value as "%PATH%;%JAVA_HOME%;" and then click ok --> ok.
See the below image for reference.

step 4: Now open the command prompt and run javac command.If you get below response,then it means that you have set java path correctly.

Ant Path
In addition to java path we need to set Ant path.
step 1:Install ant file and go to the folder where ant is installed.Copy the url and set "ANT_HOME" variable as shown in the image below.

step 2: Modify the PATH variable value as "%PATH%;%JAVA_HOME%;%ANT_HOME%\bin;" .See the image below for reference.

step 3:now open command prompt and then type "ant -version".
If you get following response,then it means that you have set ant path correctly.
see the image below for reference.
Enjoy...