1

I made a simple "plugin" for minecraft to say "Hello World!" in the minecraft server console when it is loaded. However, when it tires to load the plugin, an error occurs.

I switched the test version to 1.8 bukkit but it still won't load (my server is on 1.8)

    <repositories>
        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>


    <dependencies>
        <dependency>
            <groupId>org.bukkit</groupId>
            <artifactId>bukkit</artifactId>
            <version>1.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

This is the pom.xml file

4.06 15:56:36 [Server] ERROR Could not load 'plugins/FirstSpigotPlugin-1.0.0.jar' in folder 'plugins'

14.06 15:56:36 [Server] INFO org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: me/spoonle/fsp/FirstSpigotPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

This is the error I get.

What do I need to change on eclipse to allow the plugin to load? Do I need to prove more code for you to look at?

Spoonology
  • 73
  • 7
  • Please have a look at [link](https://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi) – maxemann96 Jun 14 '19 at 21:07
  • 3
    Possible duplicate of [How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version](https://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi) – russell Jun 14 '19 at 21:09
  • @russell you literally just copied someone elses comment. The post you guys just shared doesn't help with my problem either. – Spoonology Jun 14 '19 at 21:19
  • 1
    The first comment is just a link to the question (added manually), whereas the comment by @russell is an actual vote/flag to close this question as a duplicate and is added automatically when the vote is cast/flag is raised. As for the post helping you, it tells you the error is a difference between the Java version used to compile the code and the Java version used to execute it. You've compiled your plugin with Java 11 but apparently Minecraft uses Java 8. Code compiled in newer versions of Java cannot be executed by older versions of Java. One fix is to use Java 8 to build your plugin. – Slaw Jun 14 '19 at 21:39
  • @Slaw I already know I need to change versions. That still doesn't answer my question. My question is, "What do I need to change ON ECLIPSE TO ALLOW THE PLUGIN TO LOAD" – Spoonology Jun 14 '19 at 21:56
  • My mistake. I interpreted your question as, "_**What does this error mean** and how do I fix it in Eclipse?_". The post tells you the error and the possible fixes. It wasn't clear (to me) that you already know what the problem is and how to fix it, just not how to implement the fix specifically in Eclipse. This question may help you: [How to change JDK version for an Eclipse project](https://stackoverflow.com/questions/12588537/). – Slaw Jun 14 '19 at 22:04
  • @Slaw well you see, I'm using Maven build on my project. This doesn't work on maven. (The link you said). You need to change the version to 1.8 which I already have. – Spoonology Jun 14 '19 at 22:25
  • If you keep using Java 11 then you might be able to use `8` ([documentation](https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#release)) to cross-compile. If that doesn't work, and there's no way (I'm not sure if there is or not) to have Eclipse execute Maven with the same JDK you've set your project to use, then maybe [toolchains](https://maven.apache.org/guides/mini/guide-using-toolchains.html) can help you. – Slaw Jun 14 '19 at 22:35

1 Answers1

1

you need to change your Java JDK Version for the project to 1.8

JDK 8 -> http://jdk.java.net/java-se-ri/8-MR3

There is where to edit it on intellij, but I cant help for eclipse There is where to edit it on intellij, but I cant help for eclipse

Ticherhaz FreePalestine
  • 2,738
  • 4
  • 20
  • 46
Veroxar
  • 11
  • 2