Solved Console Error: NoSuchMethodException

Discussion in 'Plugin Development' started by mazentheamazin, Dec 15, 2013.

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

    mazentheamazin

    So, I am working on a plugin for somebody and here is the error I got:
    Code:
    13:12:12 [SEVERE] Could not load 'plugins\FatalityProject.jar' in folder 'plugin
    s'
    org.bukkit.plugin.InvalidPluginException: java.lang.NoSuchMethodException: com.m
    azentheamazin.fatalityproject.Main.<init>()
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:184)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:306)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:230)
            at org.bukkit.craftbukkit.v1_6_R2.CraftServer.loadPlugins(CraftServer.ja
    va:243)
            at net.minecraft.server.v1_6_R2.DedicatedServer.init(DedicatedServer.jav
    a:117)
            at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java
    :397)
            at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:5
    82)
    Caused by: java.lang.NoSuchMethodException: com.mazentheamazin.fatalityproject.M
    ain.<init>()
            at java.lang.Class.getConstructor0(Unknown Source)
            at java.lang.Class.getConstructor(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:176)
            ... 6 more
    And <snip> is my main class.

    Any help is appreciated.

    Thanks in advance,
    Mazen
     
  2. Offline

    The_Doctor_123

    Code:java
    1. public Main(BuycraftFix instance){
    2. BCF = instance;
    3. }

    Why on Earth do you have a constructor for your Main class?
     
  3. Offline

    RainoBoy97

    You can't have a constructor in your main class.
     
  4. Offline

    mazentheamazin

    RainoBoy97
    Don't mind if I ask, but how would I reference another method (That is in another class) in the main class? I know its sounds noobish. But if you could help me that would be awesome.
     
  5. Offline

    mydeblob

    mazentheamazin likes this.
  6. Offline

    mazentheamazin

    mydeblob
    *facepalm* yeah... I initially used that before in another class then it threw an error, so I made an constructor because I thought it would give that same error. But that seemed to work. Thanks for the help!
     
  7. Offline

    The_Doctor_123

    mazentheamazin
    You may want to learn some Java if you cannot create/get objects.
     
Thread Status:
Not open for further replies.

Share This Page