Exporting Plugin Using IntelliJ IDEA

Discussion in 'Plugin Development' started by Virgoth098, Jun 13, 2013.

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

    Virgoth098

    So I'm trying out IntelliJ after Eclipse, and I like it a lot more than Eclipse. But one issue is that I cannot for the life of me export my plugin.
    I get that I have to do this:
    Show Spoiler

    [​IMG]

    But how do I include the plugin.yml and the rest of the files in order to export it properly?
     
  2. You see the green plus on the right, just above 'PlayerJoin.jar'? Click that and then you can select what you want to export as well. Since you want to add the plugin.yml select file and then your plugin.yml . Do this will all the other things you want to add.
     
  3. Offline

    Tirelessly

    So the first thing you're going to want to do is drag "PlayerJoin compile output" from the right into "PlayerJoin.jar" on the left. Then, to add say the plugin.yml, click the little green plus, scroll to file, and direct that to the plugin.yml in your workspace.

    Show your modules tab as well if that doesn't work.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  4. Offline

    Virgoth098

    That didn't work. Here is the error:
    16:10:28 [SEVERE] Could not load 'plugins\PlayerJoin.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.ClassNotFoundException: me.Ryan.PlayerJoin.PlayerJoin
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:184)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230)
    at org.bukkit.craftbukkit.v1_5_R3.CraftServer.loadPlugins(CraftServer.java:239)
    at org.bukkit.craftbukkit.v1_5_R3.CraftServer.<init(CraftServer.java:217)
    at net.minecraft.server.v1_5_R3.PlayerList.<init(PlayerList.java:55)
    at net.minecraft.server.v1_5_R3.DedicatedPlayerList.<init(SourceFile:11)
    at net.minecraft.server.v1_5_R3.DedicatedServer.init(DedicatedServer.java:106)
    at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:382)
    at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)
    Caused by: java.lang.ClassNotFoundException: me.Ryan.PlayerJoin.PlayerJoin
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:80)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:173)
    ... 9 more
    And by my modules tab, I'm assuming you mean this?
    [​IMG]
     
  5. Offline

    Tirelessly

    Virgoth098 You did the main in your plugin.yml wrong. Show your hierarchy and plugin.yml
     
  6. Offline

    Virgoth098

    Plugin.yml -
    name: PlayerJoin
    main: me.Ryan.PlayerJoin.PlayerJoin
    version: 1.0.0
    Hierarchy -
    [​IMG]
     
  7. Offline

    Tirelessly

    Upload the jar somewhere.
     
  8. Offline

    Virgoth098

    Once I looked inside the .jar I saw that the only thing included in the file is the plugin.yml...
    How do i fix that?
     
  9. Offline

    Tirelessly

     
  10. Offline

    Virgoth098

    I did that already. And still nothing.
     
  11. Offline

    Tirelessly

    Show me. The hardest part of using IntelliJ is exporting. It does get easier though.

    Virgoth098 Also check the "Build on Make" box in artifacts.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  12. Offline

    Virgoth098

    Here, I recorded a video of everything that we went over:

    EDIT:
    I have to go to work in a few, I'll be back later and see if any of your solutions work.
     
  13. Offline

    Tirelessly

    Virgoth098 Instead of "build artifacts" use "Rebuild Project"
     
  14. Offline

    Virgoth098

    Doesn't work =[
    Same error as before.

    EDIT:
    The error in exporting seems to be that in my PlayerJoin.jar file, the only thing that's in there is the plugin.yml...
     
  15. Offline

    Tirelessly

    I know what the error seems to be... tag me in your replies so that I know you've responded. Guess it's too late for that though, because I'm not sure what the problem is. Sorry.
     
  16. Virgoth098 If you haven't changed you code after the video then it seems that you haven't imported the Eventhandler annotation properly, because it's underlined in red (don't know why it doesn't say anything in the event log though). You might consider taking a look at that and after that re-build the project.
     
  17. Offline

    Virgoth098

    kumpelblase2 The EventHandler error says: Annotation type expected
    How do I fix that? The @EventHandler is right above my method.

    EDIT: That doesn't seem to be the issue, as i just removed @EventHandler and tried to build, and it still didn't work. The only file I am getting is the plugin.yml
     
  18. Virgoth098 are you sure that you're using the correct import: org.bukkit.event.EventHandler ?
     
  19. Offline

    Virgoth098

    kumpelblase2 Fixed that, rebuilt and still nothing.

    Tirelessly So you think you can fix it?

    bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  20. Offline

    ToastHelmi

    this wokres for me

    Set it up:
    1. right-click on your Projekt
    2. Open Modul-Settings
    3. select Artifacts
    4. Add one (Alt-EINFG)
    5. configurate...

    Build:
    1. click Build
    2. select Build Artifacts
    3. build
     
  21. Offline

    Sindresgaming

    Having same problem anyone else know a fix? keep getting this
    org.bukkit.plugin.InvalidPluginException: java.lang.ClassNotFoundException:
     
Thread Status:
Not open for further replies.

Share This Page