Category: NetBeans


easily add files to META-INF in NetBeans

January 10th, 2009 — 12:07pm

These days when you find me working in Java, you’ll find me working in NetBeans. If I wanted to spend my time manually editing ant scripts, you’d probably find me working in vi instead.

I needed to add a file to META-INF in my application jar a few days ago. NetBeans provides a META-INF folder in the project window for web applications, but not for standalone java applications. There is a lot of documentation for this specific problem that will help you edit your build script to get this done but for something so basic I prefer a simpler solution.

After some experimentation I found an alternative:

  1. open the project window
  2. right-click on “Source Package”, click “New”, and choose “Folder” under the “Other” category
  3. name the new folder “META-INF”
  4. add files (.mailcap in my case) to this folder
  5. build as usual
  6. open your jar, browse to META-INF, and note that your files are now where they belong


Please note that I’m using NetBeans 6.5, and that this method could suddenly stop working in some future version of NetBeans if the build process changes dramatically.

If you have an alternative to this process that does not require build script modification, I would very much like to hear from you!

5 comments » | Java, NetBeans

NetBeans 6.5 – failed to create task or type copyfiles

November 24th, 2008 — 4:41pm

Just upgraded to NetBeans 6.5 and encountered the following error when I tried to build my project: “Problem: failed to create task or type copyfiles”. Not much detail in that message, and I hate having to delve into the generated ant scripts. Turns out that I was missing “org-netbeans-modules-java-j2seproject-copylibtask.jar” from my ./lib/CopyLibs folder. Tossed it back in there from a new project and I was back in business!

1 comment » | Java, NetBeans

Back to top