How to import an external library to a bukkit plugin

Discussion in 'Plugin Development' started by joonius, Mar 27, 2020.

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

    joonius

    Hello all. I've been writing a bukkit plugin that uses an external library in intellij. I added the library to the external library folder and everything seemed to work. But when I compiled the plugin into a jar and ran it on a bukkit server, there was an error message saying the library I added didn't exist. It seems that the library wasn't compiled in the jar file although it was included in the source code. Does anyone know what the problem is?
     
  2. Offline

    yPedx

    @joonius
    If the library is a jar, you should extract it inside your jar. If it's a plugin library, you could install it on your server along with your plugin.
    If you want the library to be inside your jar, you need to make sure it's added to your output Artifact.
     
  3. Offline

    NukerFall

    Don't use standart import of external jars. Learn how to use maven instead
     
  4. Offline

    joonius

    Actually, its not a plugin library. It's a hardware library called jSerialcomm. Can only plugin libraries be included?
    Oh, and how do you add them to the output Artefact in Intellij?
     
  5. Online

    timtower Administrator Administrator Moderator

    Any java library can be used.
     
  6. Offline

    joonius

    Caused by: java.lang.NoClassDefFoundError: com/fazecast/jSerialComm/SerialPort
     
Thread Status:
Not open for further replies.

Share This Page