[Solved] Java problem? Unsupported major.minor version 51.0

Discussion in 'Plugin Development' started by asdfaf11, Dec 30, 2011.

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

    asdfaf11

    Hello,

    I uploaded my plugin to my friend's server. The server has Java 7, and my plugin compiled under java 7 too. But I received this error:
    Code:
    Could not load 'plugins\gfhjk.jar' in folder 'plugins':
    java.lang.UnsupportedClassVersionError: me/iscpwner/gfhjk/gfhjk : Unsupported major.minor version 51.0
    
     
  2. The server has only Java 7, not Java 6 as well ? Because it might run Java 6 instead of 7 if it's not correctly configured.

    Still, you could compile the plugin under Java 6 and it will run on Java 6 and Java 7.
     
  3. Offline

    asdfaf11

    I have downloaded it and compiled, but the server give the same error again.
     
  4. Offline

    nisovin

    I would guess that the server has java 7 installed, but that java 6 is actually being used to run CraftBukkit.
     
  5. Offline

    asdfaf11

    And how i can make the plugin working on the server?
     
  6. Offline

    nisovin

    Either build it with java 6 or make sure the server runs with java 7.
     
  7. Offline

    asdfaf11

    I changed the build level to 1.6 and at the java build path, libraries the JRE System library is jre6.
    I have exported the project to jar. Should it works?
     
  8. Offline

    ItsHarry

  9. Change build level to 1.5. I had same problem.
     
  10. Offline

    gablank

    I had the same problem.

    Fix (at least this worked for me):
    - Change JDK to JRE-6
    - Set compiler compliance to 1.6.

    I noticed this is an old thread but other people just might run into the same problem and Google it to find this (as I did).
     
  11. Offline

    annamalai4445

    gablank
    can u please explain me the steps in detail i also hve the same probelm
     
  12. Offline

    gablank

    Right click on your project -> Properties -> Java Build path -> Libraries -> Add external jar -> Select JRE6 -> Java Compiler -> Check that compiler compliance level is 1.6.

    Note that you must have installed the JRE6 to do this :)
     
  13. gablank I think you mean JRE6 :p
    And also, you don't have to delete the other one, JRE7, it can stay there just not active.
     
  14. Offline

    gablank

    Of course, thanks for correcting me ;)
     
Thread Status:
Not open for further replies.

Share This Page