Import Libraries in Eclipse?

后端 未结 4 1308
隐瞒了意图╮
隐瞒了意图╮ 2020-12-02 17:16

I just recently downloaded the dom4j library, but for the life of me I have no idea how to access it. I dropped it in the plug-ins folder and rebooted Eclipse, without succe

相关标签:
4条回答
  • 2020-12-02 17:33

    If you want to get this library into your library and use it, follow these steps:

    1. You can create a new folder within Eclipse by right-clicking on your project, and selecting New Folder. The library folder is traditionally called lib.

    2. Drag and drop your jar folder into the new lib folder, and when prompted select Copy Files.

    3. Selecting the Project tab at the top of the screen, and click Properties.

    4. Select Java Build Path followed by the Libraries tab.

    5. Click the Add JARs… button and select your JAR file from within the lib folder.

    6. Your JAR file will now appear in both the lib and Referenced Libraries folders. You can explore the JAR's resources by clicking Referenced Libraries.

    0 讨论(0)
  • 2020-12-02 17:35

    Extract the jar, and put it somewhere in your Java project (usually under a "lib" subdirectory).

    Right click the project, open its preferences, go for Java build path, and then the Libraries tab. You can add the library there with "add a jar".

    If your jar is not open source, you may want to store it elsewhere and connect to it as an external jar.

    0 讨论(0)
  • 2020-12-02 17:37

    No, don't do it that way.

    From your Eclipse workspace, right click your project on the left pane -> Properties -> Java Build Path -> Add Jars -> add your jars here.

    Tadaa!! :)

    0 讨论(0)
  • 2020-12-02 17:47

    For the Android library projects, I do it as in the attached screenshot:

    Right click the project, select Properties->Android and in the library section click Add. From here you can select the available libraries.

    If you are importing a jar file, then importing them as jar or external jar, as other posters posted would work. I prefer to copy/paste jar file in the libs folder (create one if it doesn't exist) and then import as jar.

    Adding a library

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