1.8.8 Help with Java versions on Plugin

Discussion in 'Spigot Plugin Development' started by BOB1234567721, Jun 11, 2021.

  1. When trying to run my local server, I am getting the following error:

    Could not load 'plugins\CommonControl-1.0-SNAPSHOT.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: com/lociogamer/commoncontrol/CommonControl has been compiled by a more recent version of the Java Runtime (class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 52.0

    I did some research and found that I had to change the version of Java I was using. So, I changed my JDK and JRE to version 1.8 (or 52.0) but the error persists. I've checked that the version was 1.8 in my console, in the IntelliJ console, and in the about section of the Java Configure menu. I also made sure that I was using 1.8 as the SDK in the IntelliJ Project Structure Window of this specific project.

    I am using IntelliJ with Maven to create the plugin in version 1.8.8.

    Thank you in advance for any assistance!

    Attached is the full error message.

    Attached Files:

  2. Says here that it's been compiled with class version 60, so that's java 16 I think.
    Give it a shot compiling with that
  3. If you're using maven did you change the compile target in your pom to java 8?
  4. Did you remember to export the jar after you switched java versions in your IDE?
  5. I'm running MC 1.8 though. How would I run java 16 with that?
  6. I did do that, yes. POM attached.

    Attached Files:

    • pom.txt
      File size:
      1.9 KB
  7. Yep. I've recompiled it about 200 times. I've also restarted both IntelliJ and my pc several times to see if the Environment Variables needed updating.
  8. This is weird, I can't really help you because I use eclipse and never had a problem like this with it. You might want to consider using a different IDE then or reinstalling it because it may just be an issue with Java itself like a corrupted file, it's rare but these problems do happen.