简体   繁体   English

库和lib文件夹之间的区别? 我们如何将jar文件添加到lib文件夹?

[英]Difference between Libraries & lib folders ? How do we add jar files to lib folder?

When i created the dynamic web project, i will have 2 folders with name Libraries and lib. 当我创建动态Web项目时,我将有2个名为Libraries和lib的文件夹。 So during the project i added .jar files as follows 因此,在项目过程中,我如下添加了.jar文件

Build Path --> Configure Build Path--> Libraries (tab) --> Add external JAR's -- > OK

When i do this, it will add files to Libraries, However i would like to add .jar files to lib folder. 当我这样做时,它将添加文件到库中,但是我想将.jar文件添加到lib文件夹中。

在此处输入图片说明

I tried copying all .jar files from Libraries to lib, but it says 我尝试将所有.jar文件从库复制到lib,但是它说

在此处输入图片说明

Copied .jar files directly to lib folder in directory structure, but i doesn't display in eclipse. 将.jar文件直接复制到目录结构中的lib文件夹中,但是我没有在eclipse中显示。

在此处输入图片说明

I would appreciate your suggestions and inputs. 非常感谢您的建议和意见。

Copy jars into WEB-INF/lib directory by copying files themselves (not from Libraries in eclipse view) and hit refresh from eclipse, they will appear in the Web App Libraries 通过复制文件本身(而不是从eclipse视图中的库中)将jar复制到WEB-INF/lib目录中,然后从eclipse中单击刷新,它们将出现在Web App Libraries

PS: It is almost always better to use a build tool like maven/ant to manage dependencies PS:使用诸如maven / ant之类的构建工具来管理依赖几乎总是更好的选择

  • Open the lib folder in the file browser and paste all the copied jars. 在文件浏览器中打开lib文件夹,然后粘贴所有复制的jar。
  • Refresh the lib folder in the 刷新目录中的lib文件夹

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

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