开发者

Building(With ant) a jar with it's main in the default package

I was w开发者_高级运维ondering if anyone knew how to set the Main-class property in an Ant Build xml to look in the default package? I've tried just "Main", but it doesn't seem to find it.


You should use Main-Class attribute of manifest:

<jar jarfile="${jar.name}">
  <fileset dir="${classes.dir}">
     <include name="**/*.*"/>
  </fileset>
  <manifest>
     <attribute name="Main-Class" value="MyApp"/>
  </manifest>
</jar>

Docs for Ant Jar Task

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜