<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-199  評(píng)論-203  文章-11  trackbacks-0
     1、下載安裝下載:http://ant.apache.org

        需要設(shè)置的環(huán)境變量:

        ANT_HOME:ant的安裝目錄

        JAVA_HOME:jdk的安裝目錄

        PATH:把%ANT_HOME%\bin目錄加到path變量,以便于從命令行下直接運(yùn)行ant

        假定ant解壓在c:\ant   jdk裝d:\j2sdk1.4.0

        則在命令行下執(zhí)行以下命令:

    set ANT_HOME=c:\ant
    set JAVA_HOME=D:\j2sdk1.4.0
    set PATH=%PATH%;c:\ant\bin

        2、工程文件目錄結(jié)構(gòu):

        一個(gè)ant 工程目錄結(jié)構(gòu):

        C:\workspace\ant.test:工程主目錄

        \src :源程序目錄

        \build\classes :編譯后的 class 文件目錄

        \lib :開發(fā)工程所需要的類庫(kù)目錄,比如開發(fā)數(shù)據(jù)庫(kù)時(shí)所需要的 jdbc lib(這次沒用到)

        \jar :打包好的 jar 程序目錄(這次沒用到)

        \build.xml :工程配置文件\build.propertiees:工程資源文件

        2、建立工程描述文件和建立工程資源文件

        建立工程描述文件build.xml

    <?xml version="1.0"?>

    <project default="main" basedir=".">

        <echo message="pulling in property files" />
        <property file="build.properties" />

        <target name="init">
            <echo message="init. delete the old class files. and create the new folds." />
            <delete dir="${classpath}" />
            <mkdir dir="${classpath}" />
        </target>

        <target name="compile" depends="init">
            <echo message="compile the java source files." />
            <javac srcdir="src\hello\ant" destdir="${classpath}" />
        </target>

        <target name="main" depends="compile">
            <echo message="calling java to run this java project." />
            <java classname="hello.ant.HelloAnt">
                <classpath>
                    <pathelement path="${classpath}" />
                </classpath>
            </java>
        </target>

    </project>

        建立工程資源文件:build.properties

        文件內(nèi)容是下面一行內(nèi)容:

    classpath=build\\classes

        4、建立java源文件:hello.ant.HelloAnt.java

    package hello.ant;

    public class HelloAnt {
        public static void main(String[] args) {
            System.out.println("hello ant, the first time using ant... it is great.");
        }
    }

        5、編譯:

    C:\workspace\ant.test>ant -buildfile build.xml
    Buildfile: build.xml
         [echo] pulling in property files

    init:
         [echo] init. delete the old class files. and create the new folds.
       [delete] Deleting directory C:\workspace\ant.test\build\classes
        [mkdir] Created dir: C:\workspace\ant.test\build\classes

    compile:
         [echo] compile the java source files.
        [javac] Compiling 1 source file to C:\workspace\ant.test\build\classes

    main:
         [echo] calling java to run this java project.
         [java] hello ant, the first time using ant... it is great.

    BUILD SUCCESSFUL
    Total time: 890 milliseconds

    C:\workspace\ant.test>

    posted on 2009-08-20 22:07 Werther 閱讀(1384) 評(píng)論(0)  編輯  收藏 所屬分類: 18.Other
    主站蜘蛛池模板: 疯狂做受xxxx高潮视频免费| 国产黄色片在线免费观看| 久久美女网站免费| 一级毛片视频免费观看| 又粗又长又爽又长黄免费视频 | 亚洲国产日产无码精品| 亚洲精品美女久久久久| 91亚洲一区二区在线观看不卡| 久久亚洲精品中文字幕| 久久综合亚洲色一区二区三区| 亚洲日本一区二区三区| 中文字幕亚洲综合久久| 亚洲mv国产精品mv日本mv| 久久狠狠爱亚洲综合影院| 狠狠色伊人亚洲综合网站色| 亚洲人成7777| 黑人粗长大战亚洲女2021国产精品成人免费视频 | 又粗又硬又黄又爽的免费视频| 免费一级毛片免费播放| 女人18毛片特级一级免费视频 | a级毛片在线免费看| 久久精品一区二区免费看| 久久午夜夜伦鲁鲁片免费无码影视| 免费A级毛片无码视频| 在线看片免费不卡人成视频| 卡一卡二卡三在线入口免费| 免费国产不卡午夜福在线| 国产av无码专区亚洲av果冻传媒 | 中文字幕亚洲第一| 在线精品亚洲一区二区三区| 亚洲va久久久噜噜噜久久男同 | 亚洲色婷婷综合开心网| 亚洲AV无码欧洲AV无码网站| 亚洲成人免费网站| 美女黄频免费网站| 成人无码a级毛片免费| 日本zzzzwww大片免费| 四虎永久成人免费| 亚洲AV无码第一区二区三区 | 亚洲精品午夜无码电影网| 亚洲综合综合在线|