I'm now programming Minecraft Spigot plugins using the following tutorial series:
And yes I use Eclipse although it is done in the tutorial with IntelliJ, which shouldn't have any major influences now.
When I had reprogrammed everything from the tutorial there were no errors in Eclipse, but Spigot was complaining because my Java version is too new.
Spigot error message:
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: de / linus1208 / spigotplugin / main / Main has been compiled by a more recent version of the Java Runtime (class file version 56.0), this version of the Java Runtime only recognizes class file versions up to 52.0
So instead of the Java 12 library in the build path I used the Java 8 library, which according to this table: https://fabianlee.org/2018/01/19/java-determining-the-java-version-used-to-compile-a-class-class-file-has-the-wrong-version/
corresponds to the Java version of the class file version 52.0 stated in the error message.
However, when I change to Java 8 I get the following Eclipse error messages:
1. The project was not built since its build path is incomplete. Can't find the class file for java.lang.String. Fix the build path then try building this
2. The type java.lang.String can't be resolved. It is indirectly referenced from required .class files
The errors are in line 1.
What I've already tried and didn't work:
Delete project in Eclipse and re-import
Close and reopen the project
Clean and rebuild the project
Spigot version: 1.15.2 (latest version)
Does the Minecraft server run on your PC? If so, you should urgently update your Java or start the server with the latest Java version. Had the same problem a few months ago
Yes, I update Java times
I tried it again, it didn't work at first, but then I directly specified the path to the Java.exe (apparently he used the java.exe under jdk 1.8.0 to run) and it worked!