Calls to static methods in Java interfaces are prohibited in JVM target 1.6
Kruemmelspalter opened this issue ยท 4 comments
Description
I'm trying to make a plugin which gives a player a permission. In the docs, it says I should use PermissionNode.builder("my.permission").build()
but when I try to build my plugin, gradle says:
Calls to static methods in Java interfaces are prohibited in JVM target 1.6. Recompile with '-jvm-target 1.8'
I don't want to change a version or something I'm using
Reproduction steps
- Make a plugin with Kotlin
- try to set a permission / build a PermissionNode with `PermissionNode.builder([...]).build()
Expected behaviour
It works
Environment details
- Server type/version:
Spigot
running version1.15.2
buildgit-Spigot-a99063f-be6aaf0
- LuckPerms version:
v5.2.96
Any other relevant details
LuckPerms only supports Java 8 and above - you're trying to compile using Java 6.
If you're using Gradle, you need to define
sourceCompatibility = 1.8
targetCompatibility = 1.8
in your buildscript, or for Maven:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
I did that and it still doesn't work
Also, IntelliJ says that the sourceCompatibility
/ targetCompatibility
statements aren't used
Please use StackOverflow to ask "how-to" and "why-didn't-it-work" questions.
Or GoogleSearch