Use Ant's Javac task to compile Java programs

Source: Internet
Author: User
<?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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.