Hi,
I am using Linux to build my code through ant .I also have java installed so the javac task works fine and compiles the code.
Now when I type "echo $JAVA_HOME" the output is blank.So, how does the javac task finds the path to java compiler?
Ant does not need to find javac. javac and java are the same code (well, same source code), the only difference being that javac has an assume staring class while java does not. Ant doesn't bother with javac - it calls the compiler classes directly. I suspect that even if you use the "fork" option of the <javac> task that Ant doesn't need javac but rather calls java passing the main compiler class.