<?xml version= "1.0" encoding= "UTF-8"? ><project name= "Javatest" default= "Compile" basedir= "." ><!--here. Represents the current directory --><target name= "clean" ><delete dir= "Build"/></target><target Name= "Compile" depends= "clean" ><mkdir dir= "build/classes"/><javac srcdir= "src" destdir= "build/classes" /></target></project><!--Run result e:\antstudy>ant Compilebuildfile:e:\antstudy\build.xmlclean: Compile: [mkdir] Created dir:e:\antstudy\build\classes [Javac] e:\antstudy\build.xml:9: Warning: ' Includeantruntime ' is not set, defaulting to Build.sysclasspath=last; Set to False for repeatable builds [Javac] compiling 1 source file to E:\antstudy\build\classesBUILD Successfultotal t Ime:1 second--
First create a folder Antstudy (project folder)
Build another src folder (as source code directory)
Put Java programs inside
Build a Build.xml file under the Antstudy directory above
Use Ant's Javac task to compile Java programs