Ads 468x60px

Tuesday, August 16, 2011

How to build a fat jar using Netbeans

Hmm after long time with out blogging. Finally decided to add some posts to my blog. So in this post I would like to describe how to build a fat jar using NetBeans. Of course you can simply do it using Eclipse. But in Netbeans you can't actually directly build a fat jar. The jar which is build using NetBeans is not adding the libraries you've used for the project. The libraries are added to a folder called "lib" whenever you run the jar the "lib" folder must be in the same directory.

So lets get started building a fat jar using Netbeans. The first thing you have to do is clean and build the project.

Then go the Files view of the Project and open the build.xml file.

Then copy and paste the following code just before the " project" tag ends.

Download file from here DOWNLOAD FILE

Then it's almost done. Now in files view of the project right click build.xml file and then select Runtarget >> Other Targets >> package-for-store.

That's it now your fat jar has been created. Go to your project folder and check the folder called store. Inside that folder you can see your fat jar.

That's it now you know how to build a fat jar using NetBeans. If you need any help just put a comment. Cheers :)


  1. This one solved a problem of mine, mate :) Keep up the good work

  2. When stealing an article, at least link the original.

  3. @Unknown I didn't steal it. I got the script from one of my seniors.. Anyway thanks for reference.

  4. This comment has been removed by the author.

  5. Great Help !! Thanks a lot :)

  6. very thanks, therefore I can access this article by way of google . Oracle web site does'nt apper in searching

  7. I get this great post via stackoverflow, thanks a lot!

  8. Thanks this works like charm

  9. This comment has been removed by the author.

  10. shows "unable to find application class name" for javafx desktop application.............plz help

  11. Great Post. Followed the steps and it worked like a charm. Thanks.

  12. Thanks a lot! Worked perfectly

  13. Hiii...
    I am using NetBeans IDE 7.4. In which I am facing same problem.
    When I am trying same solution which is provided by author, I am not getting that option "Package-for-Store".

    Please HELP ME..!!!!
    Thanks in advance