开发者

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

开发者 https://www.devze.com 2023-01-31 21:08 出处:网络
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 shou

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

精彩评论

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