Including a library with exported JAR file?

Discussion in 'Plugin Development' started by THEK, Feb 11, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    THEK

    I need to include the Apache HTTPClient library with my plugin but all the site provides is a .jar file. This imports fine to Eclipse but it doesn't export the library with the plugin. How do I include the library when exporting?
     
  2. Offline

    bleachisback

    You need to put the jar into your workspace folder so it can be recognised by eclipse easily while exporting.
     
  3. Offline

    THEK

    It is imported, but it is ignored by Eclipse when exporting. As with Spout and RemoteEntities, however with those I can have a dependency to make sure they're running on the server. I've never need those to export. But with this library I need it to export but it won't.

    Having looked around the net all I can see is people saying to create a Runnable Jar file but it asks for launch configuration which I don't think is necessary for Bukkit plugins.
     
  4. Offline

    bleachisback

    No, I mean if you actually copy and paste the jar folder into your project folder where your source files and plugin.yml are(or click and drag into your project in eclipse), then it will recognise it.

    EDIT: Screenshot for clarity:
    [​IMG]
     
  5. Offline

    THEK

    bleachisback Ah, Cheers :)

    bleachisback Hi, sorry, thought I had it working. I'm getting ClassDefNotFound errors even though I can see the JARs in the exported file

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
  6. Offline

    chasechocolate

    THEK I would remove the Solved in the title, otherwise people won't bother to look.
     
  7. Offline

    THEK

    OK so I've been working at this all day. If I include the jars they don't get picked up by the plugin. I can't get them picked up by the class-path manifest either for some reason.

    I'm currently attempting to include the classes from Apache's HTTPClient and HTTPCore but it's drastically increasing the size of my plugin and I still haven't got all the dependencies.

    Has anyone had experience with Apache HTTPClient/Core functionality and got it working with a Bukkit plugin?

    Right now any help would be greatly appreciated as I've spent all day on this and I'm still no closer to a solution. While I could use Maven I have never even looked at Maven before.
     
Thread Status:
Not open for further replies.

Share This Page