Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 java 应用程序中有包.. a、b 和 c。我为我的应用程序设置了一个资源文件夹,它包含包 x、y、z。
我需要将 a、b 中的文件和 x 中的属性文件打包为 jar。我正在使用网豆 6.5。我如何做到这一点!
您最好的选择是编辑 nb-build.xml(或 build.xml,如果您从头开始创建项目)文件并添加一个 ant 目标(-pre-jar),将文件复制到构建目录被 jar 目标添加。
不确定 Netbeans 的具体情况,但您可以通过命令行将文件添加到 jar 中:
jar uf jar-file input-file(s)
更多细节在这里。