简体   繁体   English

移动NetBeans项目时如何包括外部库?

[英]How to include external libraries when moving my NetBeans project?

I added an external library by adding its .jar file and importing it as a normal import. 我添加了一个外部库,方法是添加其.jar文件并将其作为常规导入导入。 Now, I want to take the project as a zip file and move it somewhere else. 现在,我想将该项目作为一个zip文件并将其移至其他位置。 Is it possible to include the .jar file in the zipped file so that I can just open the project in NetBeans at the other PC and run it without the need to add the .jar file manually? 是否可以在压缩文件中包含.jar文件,以便我可以在另一台PC上的NetBeans中打开项目并运行它,而无需手动添加.jar文件? I found solutions for including the external library .jar file when we want to build the project .jar file, but I couldn't find a solution for my issue. 当我们要构建项目.jar文件时,我找到了包括外部库.jar文件的解决方案,但找不到针对我问题的解决方案。 Sorry if this is a duplicate but I tried hard to find a solution before submitting a new question. 抱歉,如果这是重复的,但是在提交新问题之前,我努力寻找解决方案。

I found the solution: 我找到了解决方案:

  1. Create a folder named lib or whatever name inside your NetBeans project folder. 在NetBeans项目文件夹中创建一个名为lib或任何名称的文件夹。
  2. Place the .jar file inside that folder. 将.jar文件放在该文件夹中。
  3. Add the .jar file to your project from NetBeans. 从NetBeans将.jar文件添加到您的项目中。
  4. Now the your project is portable with the external library .jar file. 现在,您的项目可以使用外部库.jar文件移植。

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

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