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
精彩评论