ant执行.class文件

来源:互联网 发布:后窗解析知乎 编辑:程序博客网 时间:2024/05/17 00:01
<?xml version="1.0"?> <project name="helloWorld"> <target name="hello">      <java classname="com.Test"><!--类名,包名不能漏-->          <classpath>              <path location="E:\\Workspace\\test\\bin"></path><!--类文件路径,不能加包名-->          </classpath>  <classpath>              <fileset dir="C:\\Users\\Administrator\\Desktop" includes="test.jar"></fileset><!--依赖包,多个同理-->  <!--<fileset dir="lib" includes="**/*.jar"></fileset>可用通配符-->          </classpath>      </java></target></project>


ant脚本执行java文件

build.xml

 

Test.java

package com;public class Test {public static void main(String[] args) {System.out.println("hello ant");}}


 

 

 

0 0
原创粉丝点击