简体   繁体   English

如何在Netbeans的JAR中使用内部库/引用?

[英]How to use internal libraries / references in a JAR from Netbeans?

I'm in the process of creating a JAR file using Netbeans. 我正在使用Netbeans创建JAR文件。 I am coming across a problem where I can not reference images or libraries without the /lib folder present with the JAR and my images in the JAR's current working directory. 我遇到一个问题,在没有JAR随附的/lib文件夹以及JAR当前工作目录中的图像的情况下,我无法引用图像或库。 I need this JAR to be self contained and so when I build it I make sure that my library file and associated images are all within the JAR file itself. 我需要这个JAR自成一体,因此在构建它时,请确保我的库文件和关联的图像都在JAR文件本身内。 However my manifest file seems to be pointing to outside of the JAR as do any references associated with my JAR file. 但是,清单文件似乎指向JAR外部,与我的JAR文件关联的任何引用也一样。 Is there a way within Netbeans to change these options when building? 在构建时,Netbeans中是否可以更改这些选项?

It is possible to put several files inside the Jar file, but it didn't crossed my mind to do so with the libraries. 可以在Jar文件中放入几个文件,但是我对库没有这么做。

Try to see this link: https://www.google.pt/#q=JAVA+put+libraries+inside+JAR . 尝试查看此链接: https : //www.google.pt/#q=JAVA+put+libraries+inside+JAR

As far I can see in a small rechearch, is possible using external tools, or simply using ant. 据我所知,在一次小的重试中,可以使用外部工具,也可以仅使用ant。 Check this link as well (as shown in the previous link I gave you): Put external library to the JAR? 还要检查此链接(如我之前给您的链接所示): 将外部库放入JAR?

Google is a powerfull tool, use it more often. Google是功能强大的工具,请经常使用。

I hope I could help. 希望我能帮上忙。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM