Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Missing main class Error

Comments in 'Plugin Development' started by jasonwynn10, Jan 15, 2016.

  1. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    I have been working on a plugin for my home network server and when I try to compile it, it gives me an error stating the main class cannot be found. The plugin's github link is here: https://github.com/jasonwynn10/AFKsource
  2. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    Get the ZIP, go to pmt.mcpe.me, add the ZIP, then click all the radios, then it compiles it into a .PHAR and, tells you errors.
    KubixQ, PEMapModder and jasonwynn10 like this.
  3. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    Thank you, but now the error is
    Code:
    [16:31:41] [Server thread/CRITICAL]: pocketmine\utils\PluginException: "Couldn't load plugin AFK: main class not found" (EXCEPTION) in "/src/pocketmine/plugin/PharPluginLoader" at line 70
    [16:31:41] [Server thread/EMERGENCY]: An unrecoverable error has occurred and the server has crashed. Creating a crash dump
    [16:31:41] [Server thread/EMERGENCY]: Please upload the "C:\Users\jasonwynn10\Downloads\PocketMine-MP\CrashDump_Fri_Jan_15-16.31.41-ACT_2016.log" file to the Crash Archive and submit the link to the Bug Reporting page. Give as much info as you can.
    
  4. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Change
    PHP:
    class main extends PluginBase{
    in Main.php to
    PHP:
    class Main extends PluginBase{
    KubixQ, jasonwynn10 and applqpak like this.
  5. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    ok thanks
  6. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    BTW, I posted a PR.
    jasonwynn10 likes this.
  7. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    Ok, I see it. I will merge the files when I can.
    applqpak likes this.
  8. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    The error is still occurring, any help is greatly appreciated.
  9. XFuryMCPE
    Offline

    XFuryMCPE Active Member Plugin Developer

    Joined:
    Jun 19, 2015
    Posts:
    137
    Plugins:
    2
    Minecraft User:
    XFuriousMC
    The main class is just in "src", you need to put it in src/AFK. Or change the plugin.yml so it just says: main: Main
    KubixQ and applqpak like this.
  10. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    @XFuryMCPE but it isn't in the src directory, it is in src/AFK
  11. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    http://pmt.mcpe.me already tells you all errors you are having on these aspects:
    - syntax errors
    - class path errors
    - bad practices that are discouraged
    Last edited: Jan 29, 2016
    jasonwynn10 and applqpak like this.
  12. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
    Thank You! I didn't notice the error detecting functionality of it!

Share This Page

Advertisement