简体   繁体   中英

How to add a .jar file in a Netbeans project specifying a relative path

I'm trying to add ojdbc and another .jar file into my project specifying the relative path such that, if I gave the project to a friend of mine, he would be able to import that project with all necessary .jar files already included (and so he doesn't have to pick these files, but the project .zip file is "ready-to-use").

Now, as the following image shows:

添加jar文件

I right click on my project's Libraries entry and choose the necessary .jar file. But when I try to specify a relative path, Netbeans deny it and so I could not be able to give this project (exported as a .zip file using Netbeans' export "function"), as the following image shows:

没有选择

  • What am I doing wrong?
  • Is this the right way to "include" these .jar files to the project and then export it and give it to a friend of mine?

Note that my .zip project which I import with Netbeans and my .jar file are in the same directory (Desktop):

在此处输入图片说明

Solved :

  1. Add your .jar files as shown in the 1st and 2nd images;
  2. Right click on project;
  3. Properties;
  4. Libraries;
  5. Click on that .jar file you added;
  6. Where is written "Libraries Folder" click Browse and click next.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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