Solved java.lang.UnsupportedClassVersionErro

Discussion in 'Plugin Development' started by cnniillaa, Aug 31, 2014.

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

    cnniillaa

    For some reason i get this error in console

    Here is my plugin.yml

    Code:
    name: Hub
    author: cnniillaa
    version: 1
    description: Allows User to Teleport To Spawn via /hub
    main: me.cnniillaa.Hub.Main
    commands:
      hub:
        description: Teleport To Hub!
    I am new to making plugins so im starting out with some easy basic plugins can you guys help me and tell me what i did wrong?
     
  2. Offline

    Gater12

    cnniillaa
    JavaScript? You mean Java. JavaScript and Java are entirely different languages.

    May you post the full stacktrace from the console?
     
  3. Offline

    cnniillaa

    Here you go
    CONSOLE
     
  4. Offline

    Gater12

    cnniillaa
    It appears you have compiled your code with a JDK version lower than the JRE used to run it.

    You can recompile your code with a JDK version of the same, or lower, version of the JRE used to run it.
     
  5. Offline

    cnniillaa

    So i need a JDK and JRE or?
     
  6. Offline

    Gater12

    cnniillaa
    You can recompile your code with a JDK that is the same, or lower, version JDK/JRE used to run it.

    You cannot run code compiled in Java 8 and have it run on a Java 7 environment, but you can recompile the code in Java 7 and will run on both, Java 7 and Java 8.
     
  7. Offline

    cnniillaa

    Ok so would i need to download java 7 instead of 8 .. How would i fix this xD thanks for your help though <3
     
  8. Offline

    dchaosknight

    cnniillaa

    You can compile your plugin on any version you want, though the recommended version for Bukkit plugins is Java 6 since that's what CraftBukkit is built on. The only restriction is that you MUST run the plugin on a JRE of that version or higher (i.e. if you compiled it with Java 8, you have to run it with Java 8. If it's compiled with Java 7, you can run it on either 7 or 8, and so on).
     
  9. Offline

    cnniillaa

    Forgive me for not fully being in understanding .. But to clarify
    I need My [JDK] to be 7 instead 8 than correct?
     
  10. Offline

    dchaosknight

    cnniillaa
    If you're running the plugin on Java 7, yes.
     
  11. Offline

    cnniillaa

    Thanks for your help guys i got it :D
     
Thread Status:
Not open for further replies.

Share This Page