Eclipse: Adding all the jars from a folder in java classpath

前端 未结 3 1209
北海茫月
北海茫月 2020-12-29 21:44

Is there a way to include all the jar files within a directory in the classpath using Eclipse?

It can be done by using command line by the following command:

相关标签:
3条回答
  • 2020-12-29 22:36

    Instead of using a folder outside of your project, copy all necessary JARs into a lib/ folder inside of your project.

    Now you can select all JARs in that folder, right click -> Build Path -> Add To Build Path.

    Alternatively, you can define a "User Library" which contains all the JARs and add that single item to your project's build path.

    But the best solution IMO, is to use Maven for this. Get the M2E Plugin for Eclipse and convert your project to a Maven project. Now you can use "Add Dependency" to add millions of other project (including everything they need) to your project. Maven will download and manage the dependencies for you.

    0 讨论(0)
  • 2020-12-29 22:42

    Right Click Project -> Properties.. -> Java Build Path -> Libraries -> Add Class Folder...

    0 讨论(0)
  • 2020-12-29 22:43

    Not without a Plug-in. I do not know why this feature is not a basic part of eclipse.

    https://github.com/benjchristensen/SimpleDirectoryContainer_EclipsePlugin

    0 讨论(0)
提交回复
热议问题