1
我寫了下面的Ant目標:使用Ant和genJar創建一個可運行的jar
<target name="approval_request_parser_compile">
<taskdef resource="genjar.properties" classpath="GenJar.jar"/>
<genjar jarfile="prod/lib/approvalRequestParser.jar">
<class>
<fileset dir=".">
<include name="com.bet.Check.class"/>
<include name="com.bet.Approve.class"/>
<include name="com.bet.CheckText.class"/>
<include name="com.bet.Request.class"/>
<include name="com.bet.ApprovalRequestParser.class"/> #contains the main method
</fileset>
</class>
<classpath>
<fileset dir="lib">
<include name="*.jar" />
</fileset>
<pathelement path="."/>
</classpath>
</genjar>
</target>
罐子創建成功,但是當我去/生產/ lib和I型:
java -jar approvalRequestParser.jar
引發此錯誤:
no main manifest attribute, in approvalRequestParser.jar
任何想法?