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.

Ankit
  • 6,772
  • 11
  • 48
  • 84

1 Answers1

0

This is what is needed

The jar attribute should be replaced with jarfileset like this.

<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>
oers
  • 18,436
  • 13
  • 66
  • 75
Ankit
  • 6,772
  • 11
  • 48
  • 84
  • @oers Why would you delete those 43 characters :D. – Ankit Apr 28 '12 at 16:01
  • there is no need to apologize :) and it is clear that you solved it, because you wrote an answer. It is superfluous information :) – oers Apr 30 '12 at 06:23