ANT super simple start

xiaoxiao2021-03-06  20

Ant is a very powerful tool, not learning, can't practice;

A ultra-simple EXAMPLE:

Objective: Complete a Java class compile with an ANT tool and you want to see the result, and the prompt process is completed.

process:

1, download Ant: to http://ant.apache.org Website Download the latest version of Ant1.6.2, Apache-ant-1.6.2-bin.zip, unzip to D: / Ant directory

2, set the environment variable: ant_home = d: / antjava_home = d: /borland/jbuilderx/jdk1.4path=%Path%;% java_hme% / bin;% ant_home% / bin

3. Write the Java class: public class test {public static void main (string [] arg) {system.out.println ("Hello Ant !!");}} Saved to Test.java

4. Write build.xml files: put build.xml and test.java Put in the E: / TEST / directory

5,

6, running Ant: Enter in the DOS command window CD E: / TESTE: Ant output: E: / test> antbuildfile: build.xmlcompile: [echo] Ant Start! [Java] hello ant !! [echo] ant end! Build SuccessFultotal Time: 2 SecondSe: / Test>

Note: 1. Ant_home directory does not contain the symbols such as '-', I have problems in the decompression into the default apache-Ant-1.6.2-bin directory.

转载请注明原文地址:https://www.9cbs.com/read-42752.html

New Post(0)