???????3???????Jar?????????
??????com.ant.test03??????????Testjar.java???????????£?

package com.ant.test03;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JButton;
import javax.swing.JFrame;
public class TestJar {
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setSize(new Dimension(200?? 300));
frame.setBackground(new Color(200?? 200?? 200));
frame.setAlwaysOnTop(true);
frame.getContentPane().add(new JButton("Test Ant"));
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
????build.xml?????????£?
<?xml version="1.0" encoding="utf-8"?>
<project name="myAntProject" default="dist" basedir=".">
<property name="compile" value="compile" />
<property name="dist" value="dist" />
<target name="preprocess" >
<mkdir dir="${compile}" />
<mkdir dir="${dist}" />
</target>
<target name="myCompile" depends="preprocess">
<javac srcdir="src" destdir="${compile}">
</javac>
</target>
<target name="dist" depends="myCompile">
<jar destfile="${dist}/package.jar" basedir="${compile}">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="com.ant.test03.TestJar" />
</manifest>
</jar>
</target>
</project>
???????к????MyEclipse??????????????dist????????????package.jar???????????????С?