http://georgeinfo.blog.163.com/blog/static/16368334120101019104044650/

————————————————————————————————————————————————————————————

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!

easily add files to META-INF in NetBeans的更多相关文章

  1. [转]Easily Add a Ribbon into a WinForms Application

    本文转自:https://www.codeproject.com/articles/364272/easily-add-a-ribbon-into-a-winforms-application-cs ...

  2. VC++6.0 add files to project 造成Visual Studio崩溃的解决方法

    1.下载filetool.exe,然后将文件解压在一个小文件夹内2.打开filetool.dsw 在release模式下编译程序,复制filetool.dll3.放在VC6.0安装目录AddIns的下 ...

  3. How can I add files to a Jar file? (or add a file to a zip archive)

    https://stackoverflow.com/questions/12239764/how-can-i-add-files-to-a-jar-file M.java class M{ publi ...

  4. "Hello World!" for the NetBeans IDE

    "Hello World!" for the NetBeans IDE It's time to write your first application! These detai ...

  5. NetBeans部署项目(Extjs)报错(一)

    NetBeans部署项目(Extjs)报错(一) 1.用NetBeans将项目部署到Tomcat中,报错. 具体如下: ant -f D:\\NetBeans\\workspace\\Foundati ...

  6. FreeHttp (a fiddler add in to temper the http)

    introduction FreeHttp is a Fiddler plugin. With FreeHttp you can modify the request or response mess ...

  7. Adding Cache-Control headers to Static Files in ASP.NET Core

    Thanks to the ASP.NET Core middleware pipeline, it is relatively simple to add additional HTTP heade ...

  8. [Nuxt] Add CSS Libraries to Nuxt

    You can easily add CSS libraries to Nuxt using yarn or npm to install them, then simply adding them ...

  9. Transferring Files to Your Instance with WinSCP

    WinSCP is a GUI-based file manager for Windows that allows you to upload and transfer files to a rem ...

随机推荐

  1. makefile使用

    linux make手册:http://www.gnu.org/software/make/manual/make.html 一篇文章: 假设我们有一个程序由5个文件组成,源代码如下:/*main.c ...

  2. Java根据html模板创建 html文件

    1.创建html的java代码 package com.tydic.eshop.util; import java.io.FileInputStream; import java.io.FileOut ...

  3. 修练8年C++面向对象程序设计之体会

    http://pcedu.pconline.com.cn/empolder/gj/c/0504/609482_1.html

  4. error LNK2005 new,delete 等已经在LIBCMT.lib(delete.obj) 中定义 错误修正

    http://blog.csdn.net/funnyskyf/article/details/5938597 1>uafxcw.lib(afxmem.obj) : error LNK2005: ...

  5. POJ3485 区间问题

    题目描述有些坑.. 题意: 有一条高速公路在x轴上,从(0,0)到(L,0).周围有一些村庄,希望能够在高速公路上开通几个出口,使得每个村庄到最近的出口距离小于D,求出最少需要开通多少个出口. 解题思 ...

  6. Qt之自定义界面(右下角冒泡)

    简述 网页右下角上经常会出现一些提示性的信息,桌面软件中也比较常见,类似360新闻.QQ消息提示一样! 这种功能用动画实现起来很简单,这节我们暂时使用定时器来实现,后面章节会对动画框架进行详细讲解. ...

  7. 无线端不响应键盘事件(keydown,keypress,keyup)

    今天在项目时,在android手机上使用输入法的智能推荐的词的话,不会触发keyup事件,一开始想到在focus时使用一个定时器,每隔100ms检测输入框的值是否发生了改变,如果改变了就作对应的处理, ...

  8. windows下MySql没有setup.exe时的安装方法

    01.把 mysql-advanced-5.6.17-winx64.zip 解压到自定义 D:\mysql-5.6.17-W64 或 D:\mysql-advanced-5.6.17-winx64 目 ...

  9. 认识solr结构,了解核心的文件目录

    下载solr并解压后,发现solr的目录里有很多的东西,此时我们可能会感到很恐慌,不知如何下手,下面让我带你认识它. 1.解压后的solr目录结构如下: 虽然里面有很多的文件,但是我们需要的其实就两个 ...

  10. SharePoint 2010 列表项事件接收器 ItemAdded 的使用方法

    列表项事件处理器是继承于Microsoft.SharePoint.SPItemEventReceiver的类,Microsoft.SharePoint.SPItemEventReceiver类提供了许 ...