我想知道是否有人知道如何在 Ant Build xml 中设置 Main-class 属性以查看默认包?我只试过“Main”,但它似乎没有找到它。
最佳答案
你应该使用 manifest
的 Main-Class
属性:
<jar jarfile="${jar.name}">
<fileset dir="${classes.dir}">
<include name="**/*.*"/>
</fileset>
<manifest>
<attribute name="Main-Class" value="MyApp"/>
</manifest>
</jar>
关于java - 在默认包中构建(使用 ant)一个 jar,它是主要的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4484647/