java如何打包

来源:百度知道 编辑:UC知道 时间:2024/06/01 12:12:45
写了个程序如何把它打包啊

建议使用ANT打包工具,下载地址:http://apache.justdn.org/ant/binaries/apache-ant-1.6.5-bin.zip

此工具用java编写,跨平台,能实现很多功能:编译、打包、运行、文件操作、数据库操作、自定义任务等。

主要使用方法:在工程目录下编写build.xml配置文件,然后运行ant即可:
#ant

#java -jar ant.jar
下面给你提供一个例子,是jakarta-oro-2.0.8的包的build.xml
<?xml version="1.0"?>
<project default="jar">

<!-- Allow properties following these statements to be overridden -->
<!-- Note that all of these don't have to exist. They've just been defined
incase they are used. -->
<property file="build.properties"/>
<!--
<property file=".ant.properties"/>
<property file="${user.home}/.ant.properties"/>
<property file="default.properties"/>
-->