1、ANT方式
buid.xml内容:
<project name="TestHadoop" default="compile" basedir="."> <property name="build" location="build" /> <path id="hadoop-classpath"> <fileset dir="D:\Lab\lib\hadoop\hadoop-1.2.1/lib"> <include name="**/*.jar" /> </fileset> <fileset dir="D:\Lab\lib\hadoop\hadoop-1.2.1"> <include name="**/*.jar" /> </fileset> </path> <target name="compile"> <mkdir dir="${build}" /> <javac includeantruntime="false" srcdir="src" destdir="${build}"> <classpath refid="hadoop-classpath"/> </javac> <jar jarfile="pc.jar" basedir="${build}" /> </target> <target name="clean"> <delete dir="${build}" /> </target> <target name="print-cp"> <property name="classpath" refid="hadoop-classpath"/> <echo message="classpath= ${classpath}"/> </target> </project>
2、IntelliJ IDEA
Windows平台使用ANT或IntelliJ IDEA编译生成Jar
时间: 2024-11-05 07:28:59