Attach Jar to Project

Discussion in 'Plugin Development' started by GeekPlaya, Sep 9, 2011.

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


    Alright, so I am using JavaMail API. I have added the 'External Jar' and the coding accepts it like it is there.

    The moment I run it in my server, I get the following message:
    Could not load 'plugins/Email.jar' in folder 'plugins':
    java.lang.NoClassDefFoundError: javax/mail/MessagingException
    What am I doing wrong? Could you please give a tutorial on how to fix this?
  2. Offline


    put the external jar inside the in the /lib folder of your plugin's jar
  3. That will only work if the external mail jar is installed on the server. Use suggestion above ^^
  4. Offline


    It's in the LIB folder but still getting this error... Do you need pictures?
  5. Offline


    The error says it's looking for the external jar in the plugins folder over the lib folder. Try putting it there instead.
  6. Offline


  7. Offline


    Anything to do with the error at the beginning says it looks for Email.jar whereas you included mail.jar? I'm just guessing here, there really shouldn't be any problems. D:
  8. Offline


    That says it cannot load the plugin (named Email.jar) because it's missing the class included in the JavaMail API (in other words: it can't find the API jar). Don't know how to fix this.
  9. Offline


  10. Offline


    TnT Necro~!
  11. include the source of the jar at the file of the pllugin, or include it at the lcass path of the server when you start it up
  12. Offline

    Sagacious_Zed Bukkit Docs

    You can also modify the way the server is launched. Instead of using the -jar flag you use the -cp flag and manually declare the main class.

    for instance.
    java -cp craftbukkit.jar:javax-mail.jar Main
    Other options include shading it with maven.
    I am however not sure, if bukkit respects manifest entries in plugins.
Thread Status:
Not open for further replies.

Share This Page