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. Kafka学习笔记

    一.Kafka使用背景 1. Kafka的定义 是一个分布式消息系统,由LinkedIn使用Scala编写,用作LinkedIn的活动流(Activity Stream)和运营数据处理管道(Pipel ...

  2. mac 下php运行bug

    如下所说bug在window下没有,在mac下存在. mac下的php报如下错误: fopen("data.json") Error: failed to open stream: ...

  3. How to install JDK (Java Development Kit) on Linux

    This tutorial will guide you on how to install JDK (Java Development Kit) on Linux. Since I use Cent ...

  4. 11月下旬poj其他题

    poj1000,poj1003,poj1004,poj1064,poj1218 水题 poj1012:0<k<14——漂亮的打表 poj1651:与能量项链很像的dp poj1159:回文 ...

  5. uvaIrrelevant Elements

    唯一分解定理. 可以看出在最后每个a的系数是杨辉三角的第n行. 但是不能递推,否则会tle. 就从C(n-1,0)开始乘n-k再除以k.记录下每个的系数,如果该项系数小于m就代表和答案有关. 代码里的 ...

  6. LA 5059 (找规律 SG函数) Playing With Stones

    题意: 有n堆石子,两个人轮流取,每次只能取一堆的至少一个至多一半石子,直到不能取为止. 判断先手是否必胜. 分析: 本题的关键就是求SG函数,可是直接分析又不太好分析,于是乎找规律. 经过一番“巧妙 ...

  7. Share SDK分享

    import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.os. ...

  8. UVA 1151 Buy or Build (MST最小生成树,kruscal,变形)

    题意: 要使n个点之间能够互通,要使两点直接互通需要耗费它们之间的欧几里得距离的平方大小的花费,这说明每两个点都可以使其互通.接着有q个套餐可以选,一旦选了这些套餐,他们所包含的点自动就连起来了,所需 ...

  9. Android下二维码的扫描

    Android平台下 二维码的扫描一般采用: Zxing:参考地址 Zxing功能比较强大,支持条形码和二维码的扫描,用的人也比较多,但是Zxing太大,一般开发简单的app,用起来比较麻烦. 所以网 ...

  10. css清除浮动的两种方式(clearfix和clear)

    最近总是在用浮动,这两种方式总是浮现在眼前,或者说去掉父级和同级浮动样式总在思考中.两种方式怎么写都在base.css中. 在做瑞祥之旅的过程中,还是吃了一个大亏,就是清除浮动,不管是同级还是父级,都 ...