熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> Java開源技術 >> 正文

Ant的配置使用入門[3]

2022-06-13   來源: Java開源技術 

    建立工程資源文件buildproperties

    文件內容是下面一行內容

    classpath=build\\classes

    建立java源文件helloantHelloAntjava

    package helloant;
    public class HelloAnt {
    public static void main(String[] args) {
    Systemoutprintln(hello ant the first time using ant it is great);
    }
    }

    編譯

    C:\workspace\anttest>ant buildfile buildxml
    Buildfile: buildxml
    [echo] pulling in property files
    init:
    [echo] init delete the old class files and create the new folds
    [delete] Deleting directory C:\workspace\anttest\build\classes
    [mkdir] Created dir: C:\workspace\anttest\build\classes
    compile:
    [echo] compile the java source files
    [javac] Compiling source file to C:\workspace\anttest\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: milliseconds
    C:\workspace\anttest>

[]  []  []  


From:http://tw.wingwit.com/Article/program/Java/ky/201311/29295.html
  • 上一篇文章:

  • 下一篇文章:
  • 推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.