Solved Not sure what the issue is, but my plugin isn't starting with this error

Discussion in 'Plugin Development' started by PerezHD, Jan 22, 2015.

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

    PerezHD

    Hey guys, I am getting an error on my plugin when loading.
    Code:
    [02:39:00] [Server thread/INFO]: Set PluginClassLoader as parallel capable
    [02:39:00] [Server thread/ERROR]: Could not load 'plugins/FlexMobLoot.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: com/flexprison/FlexMobLoot/Main : Unsupported major.minor version 52.0
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[minecraft_server.jar:git-Spigot-29dbaa7-262c777]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[minecraft_server.jar:git-Spigot-29dbaa7-262c777]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [minecraft_server.jar:git-Spigot-29dbaa7-262c777]
    at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.java:288) [minecraft_server.jar:git-Spigot-29dbaa7-262c777]
    at net.minecraft.server.v1_8_R1.DedicatedServer.init(DedicatedServer.java:152) [minecraft_server.jar:git-Spigot-29dbaa7-262c777]
    at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:494) [minecraft_server.jar:git-Spigot-29dbaa7-262c777]
    at java.lang.Thread.run(Thread.java:745) [?:1.7.0_71]
    Caused by: java.lang.UnsupportedClassVersionError: com/flexprison/FlexMobLoot/Main : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.7.0_71]
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800) ~[?:1.7.0_71]
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[?:1.7.0_71]
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) ~[?:1.7.0_71]
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71) ~[?:1.7.0_71]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361) ~[?:1.7.0_71]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[?:1.7.0_71]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_71]
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[?:1.7.0_71]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[minecraft_server.jar:git-Spigot-29dbaa7-262c777]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[minecraft_server.jar:git-Spigot-29dbaa7-262c777]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[?:1.7.0_71]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[?:1.7.0_71]
    at java.lang.Class.forName0(Native Method) ~[?:1.7.0_71]
    at java.lang.Class.forName(Class.java:274) ~[?:1.7.0_71]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[minecraft_server.jar:git-Spigot-29dbaa7-262c777]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[minecraft_server.jar:git-Spigot-29dbaa7-262c777]
    ... 6 more
    Not sure what the issue is at all.

    CODE FOR MAIN:
    Code:
    package com.flexprison.FlexMobLoot;
    
    import com.flexprison.FlexMobLoot.Events.EventListener;
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class Main extends JavaPlugin {
    
        public static Main plugin;
    
        public void onEnable()
        {
            plugin = this;
    
            loadConfiguration();
    
            PluginManager pm = getServer().getPluginManager();
            log("[ Enabling FlexMobLoot ]");
            pm.registerEvents(new EventListener(this), this);
    
        }
    
        public void onDisable()
        {
            PluginDescriptionFile pdf = getDescription();
            log("[ Disabling FlexMobLoot ]");
        }
    
        public void log(String msg)
        {
            getServer().getLogger().info(msg);
        }
    
        private void loadConfiguration(){
            getConfig().addDefault("chance_of_drop", Integer.valueOf(50));
            saveConfig();
        }
    }
    
     
  2. Offline

    mine-care

    What version is your plugin compiled on?
     
  3. Offline

    mythbusterma

    @PerezHD

    You built your plugin with Java 8, your server is running Java 7.

    Fix one of the two problems.
     
    mine-care likes this.
  4. Offline

    PerezHD

    Thanks I realized my Intellij was on 1.8
     
  5. Offline

    teej107

    @PerezHD I came to help but then realized that my help wasn't needed. Please mark your thread with the 'solved' prefix.
     
  6. Offline

    bwfcwalshy Retired Staff

    @teej107 Me too.
    Added Solved prefix.
     
Thread Status:
Not open for further replies.

Share This Page