[IntelliJ] Cannot Resolve Symbol ''

Discussion in 'Plugin Development' started by Eos, Jul 1, 2015.

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

    Eos

    I've been getting this error when i'm trying to make a a listener and call it from my core class.

    Core.java
    Error: Cannot Resolve Symbol 'WorldBorderListener'
    Code:
    public void onEnable(){
    plugin =this;
    Bukkit.getConsoleSender().sendMessage(enable);getServer().getPluginManager().registerEvent(new WorldBorderListener(this), this);}
    
    WorldBorderListener.java
    Error: Cannot Resolve Symbol 'WorldB'
    Code:
    WorldB plugin;
    public WorldBorderListener(WorldB plugin){this.plugin = plugin;}
    
    I'm pretty sure this happens in Intellij only I made my listeners like this in eclipse and I had no problem whatsoever.
     
  2. Offline

    Ruptur

    @Eos
    Cannot Resolve Symbol: The declared class or variable does not exist.

    Are you spelling the WorldBorderListener class right? Its case sensitive so that might be the problem.
    When using intellij press (alt+enter) on an error and it narrows your problem.
     
  3. Offline

    nverdier

    @Eos Do you have a class called `WorldB`? Please post all relevant classes.
     
  4. Offline

    Eos

    That just fixed my problem thank you,
    @nverdier
    @Ruptur
    I'm getting another error again but in the core class it says WorldBorderListener cannot be applied to packagename.core
     
    Last edited: Jul 1, 2015
  5. Offline

    Eos

    bump
     
  6. Offline

    mythbusterma

    @Eos

    In what context is that error appearing?
     
  7. Offline

    Eos

    bump
     
  8. Offline

    stefvanschie

    registerEvents
    ?
     
  9. Offline

    Tecno_Wizard

    @Eos, do you have an incorrect visibility modifier somewhere?
     
  10. Offline

    Eos

    This is the error
    WorldBorderListener cannot be applied to packagename.core
    Um, I don't think I do.

    CORE CLASS

    Code:
        public static ConfigHandler configHandler = new ConfigHandler();
    
        String enable = ChatColor.GREEN + "???? ??? Enabled"; // Enable Message
        String disable = ChatColor.RED + "???? ??? has been Extinguished";
        public static Plugin plugin;
    
        @Override
        public void onEnable(){
            Bukkit.getConsoleSender().sendMessage(enable);
            configHandler.loadConfiguration();
            plugin.getServer().getPluginManager().registerEvents( new WorldBorderListener(this), this);
            plugin = this;
        }
    WORLDBORDERLISTENER CLASS
    Code:
       public  WorldBorderListener wb;
    
        public WorldBorderListener(WorldBorderListener plugin){
            this.wb = plugin;
        }
     
  11. @Eos Why are you putting the class in the class constructor?
     
    Last edited: Jul 5, 2015
  12. Offline

    Tecno_Wizard

    @bwfcwalshy, I bet that's the cause of the error. It's an infinite recursion. You cannot instanciate the class.
     
    Last edited: Jul 5, 2015
    bwfcwalshy likes this.
Thread Status:
Not open for further replies.

Share This Page