当我想使用任何特定的库时,我主要使用 JAR 文件。我将它放在我的项目文件夹的 WEB-INF/lib 中。
但是,如果由于某种原因一个库只提供其源而不是 JAR,那么我将如何正确地进行。
我是否使用某些软件将其转换为 JAR 文件?(如果是这种情况,你觉得哪个好)或者有没有办法也添加 src 文件夹?
right click on the project, go to Java Build Path and then:
1) if you have the only the .java files and need to compile it then click on the "Source" tab and select "Add Folder" which will bring up a folder chooser dialog. when the source folder is added, then eclipse will compile it and put the classes in the default output folder along with your other source code.
2) if you already have the .classes in a folder somewhere you can click on the "Libraries" tab and then click either "Add Class Folder" or "Add External Class Folder". I've never actually used this option but that would appear to be what you want.
您可以通过右键单击在eclipse中添加一个jar
Project --> Build Path --> Configure Build Path.
在源下添加文件夹或链接源