[Fixed] HelloWorld Error

Discussion in 'Spigot Plugin Development' started by ChazzaPlays, May 28, 2015.

Thread Status:
Not open for further replies.
  1. Hello,
    Im new to Coding (Started learning Plugin stuff today however last couple of days ive learnt Java things like Arrays, integers etc)

    I followed the Bukkit plugin tutorial page and everything was fine in compiling however my server will not let my plugin run.

    Thats my log:
    Code (Text):
    [14:47:36] [Server thread/ERROR]: Could not load 'plugins/HelloWorld.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: me/charlie/helloworld/Hello : Unsupported major.minor version 52.0
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot.jar:git-Spigot-c5146ba-01930e2]
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[spigot.jar:git-Spigot-c5146ba-01930e2]
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [spigot.jar:git-Spigot-c5146ba-01930e2]
            at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:291) [spigot.jar:git-Spigot-c5146ba-01930e2]
            at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:198) [spigot.jar:git-Spigot-c5146ba-01930e2]
            at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:528) [spigot.jar:git-Spigot-c5146ba-01930e2]
            at java.lang.Thread.run(Thread.java:745) [?:1.7.0_79]
    Caused by: java.lang.UnsupportedClassVersionError: me/charlie/helloworld/Hello : Unsupported major.minor version 52.0
            at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.7.0_79]
            at java.lang.ClassLoader.defineClass(ClassLoader.java:800) ~[?:1.7.0_79]
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[?:1.7.0_79]
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) ~[?:1.7.0_79]
            at java.net.URLClassLoader.access$100(URLClassLoader.java:71) ~[?:1.7.0_79]
            at java.net.URLClassLoader$1.run(URLClassLoader.java:361) ~[?:1.7.0_79]
            at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[?:1.7.0_79]
            at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_79]
            at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[?:1.7.0_79]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[spigot.jar:git-Spigot-c5146ba-01930e2]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot.jar:git-Spigot-c5146ba-01930e2]
            at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[?:1.7.0_79]
            at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[?:1.7.0_79]
            at java.lang.Class.forName0(Native Method) ~[?:1.7.0_79]
            at java.lang.Class.forName(Class.java:274) ~[?:1.7.0_79]
            at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[spigot.jar:git-Spigot-c5146ba-01930e2]
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot.jar:git-Spigot-c5146ba-01930e2]
            ... 6 more
     
  2. Version 52.0 relates to Java 8. It seems to be unable to support Java 8, so try compiling your code with Java 7 (Or Java 6, which is what Minecraft was coded in)
     
    • Agree Agree x 1
    • Informative Informative x 1
  3. When using eclipse right click your project --> properties --> java compiler. Uncheck the "Use compilance from execution environment" there and select 1.6 in the dropdown menu below that checkbox

    Then re-export your plugin and try again!
     
  4. Thanks so much! :D
     
Thread Status:
Not open for further replies.