IntelliJ IDEA Debugging

Discussion in 'Plugin Development' started by Danza, Mar 23, 2011.

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


    Hi. Anybody know how make debug in intellij IDEA with bukkit. my plugin crushing at start every time(bukkit says "could not load plugins\myplugin.jar") and i cant understand why, so it happening... im trying run debugging in intellij but cant understand what need to do in "run/debug edit configurations".

    Help me pls :)

    server log:

    name: [HoneyGreifers]
    main: com.danzan.HoneyGreifers.HoneyGreifers
    version: for Bukkit[560]
  2. Offline


    I'm going to be honest with you, I don't know that software...
    I would suggest you to use NetBeans and look at kneeven's tutorial on debugging with it:

    Now about your error, I can't tell you without seen the src
    still... try this:

    name: [HoneyGreifers] //try taking off those []
    main: com.danzan.HoneyGreifers.HoneyGreifers //your package must be com.danzan.HoneyGreifers.* couse the 2nd HoneyGreifers is the jar name
    version: for Bukkit[560] //version is usually used to say your plugin version not bukkits version ;)
  3. Offline


    name: HoneyGreifers
    main: com.danzan.HoneyGreifers.*
    version: for Bukkit[560]

    not helps... but thank u for link(its working, but not help in my situation :) everythink crashes before onEnabled starts... dont know why...
  4. Offline


    no no the idea is:
    If you package is com.danzan
    name: HoneyGreifers
    main: com.danzan.HoneyGreifers
    version: for Bukkit[560]
    If you package is com.danzan.HoneyGreifers
    name: HoneyGreifers
    main: com.danzan.HoneyGreifers.HoneyGreifers
    version: for Bukkit[560]
  5. Offline


    package is com.danzan.HoneyGreifers
    and class is HoneyGreifers

    anyway both variants not works... cant understand.

    package com.danzan.HoneyGreifers;
    import com.nijiko.permissions.PermissionHandler;
    import com.nijikokun.bukkit.Permissions.Permissions;
    import org.anjocaido.groupmanager.GroupManager;
    import org.bukkit.Location;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Event;
    import org.bukkit.event.Event.Priority;
    import org.bukkit.plugin.Plugin;
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.PluginManager;
    import java.sql.*;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.Properties;
     * AntiGreif.
     * @author Danzan
    public class HoneyGreifers extends JavaPlugin {
        private final HGPlayerListener playerListener = new HGPlayerListener(this);
        private final HGBlockListener blockListener = new HGBlockListener(this);
        private final HGEntityListener entityListener = new HGEntityListener(this);
        public static final HashMap<Player, greifStatus> allowed = new HashMap<Player, greifStatus>();
        File Folder;
        Properties Props = new Properties();
        public String FirstPos;
        public String SecondPos;
        public String SpawnPos;
        public String DataBase;
        public String Login;
        public String Password;
        public String EnablePlugin;
        public String Managers;
        public String CountBreaks;
        public String TimeToAutomaticAdd;
        public String TimeToMsgManager;
        public static void main(String[] args) {}
        public void onDisable() {
            //System.out.println("Goodbye world!");
        public void onEnable() {
            if (!this.getDataFolder().exists()) {
            PluginManager pm = getServer().getPluginManager();
            pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Priority.Normal, this);
            pm.registerEvent(Event.Type.PLAYER_QUIT, playerListener, Priority.Normal, this);
            pm.registerEvent(Event.Type.PLAYER_CHAT, playerListener, Priority.High, this);
            pm.registerEvent(Event.Type.PLAYER_RESPAWN, playerListener, Priority.Normal, this);
            pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, playerListener, Priority.High, this);
            pm.registerEvent(Event.Type.PLAYER_MOVE, playerListener, Priority.High, this);
            pm.registerEvent(Event.Type.PLAYER_DROP_ITEM, playerListener, Priority.Normal, this);
            pm.registerEvent(Event.Type.PLAYER_PICKUP_ITEM, playerListener, Priority.Normal, this);
            pm.registerEvent(Event.Type.PLAYER_TELEPORT, playerListener, Priority.Normal, this);
            pm.registerEvent(Event.Type.PLAYER_LOGIN, playerListener, Priority.High, this);
            pm.registerEvent(Event.Type.BLOCK_PLACED, blockListener, Priority.High, this);
            pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Priority.High, this);
            pm.registerEvent(Event.Type.ENTITY_DEATH, entityListener, Priority.Normal, this);
            pm.registerEvent(Event.Type.ENTITY_DAMAGED, entityListener, Priority.Normal, this);
            PluginDescriptionFile pdfFile = this.getDescription();
            System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" );
    this is main code.

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


    I can't seem to find any errors on your code, try getting updated versions of the bukkit lib and craftbukkit, but I don't think that's the problem
  7. Offline


    still cant find wayout... ill try create new project and copypaste into code by pieces everytime build and try it, maybe then i can find bad code.
  8. Offline


    your plugin.yml needs to look like this, and make sure you export it into the jar, the error log is only saying that it doesnt recognize your plugin, usually caused by a bad yml

    name: HoneyGreifers
    main: com.danzan.HoneyGreifers.HoneyGreifers
    version: for Bukkit[560]
  9. Offline


    darknesschaos, i think u was right cause i recreate project copy in all code and everythinks work(except my logic errors) :)
Thread Status:
Not open for further replies.

Share This Page