0

I have a Netbeans Java project. When I build my project it create a directory dist and dist/lib. It stores the Jar of the file in dist and other jar files on which the main jar file depends, in the lib directory.

Now I want to create a release for OSX. For that I am using the jarbundler ant task like this

<target name="mac">
        <mkdir dir="release"/>
        <taskdef name="jarbundler"
        classname="net.sourceforge.jarbundler.JarBundler" />
        <jarbundler dir="release"
            name="MyApp"
            mainClass="controller.MyApp"
            jar="dist/MyApp.jar" />
</target>

This creates the app with the jar, but how do I add the dependent libraries to the app.

4

1 回答 1

0

这是需要的

jar属性应该像这样替换为jarfileset

<target name="mac">
      <mkdir dir="release"/>
      <taskdef name="jarbundler"
               classname="net.sourceforge.jarbundler.JarBundler" />

               <jarbundler dir="release"
                           name="MyApp"
                           mainClass="controller.MyApp">
                      <jarfileset dir="dist">
                          <include name="**/*.jar" />
                      </jarfileset>
               </jarbundler>
</target>
于 2012-04-27T18:38:09.233 回答