LuckPerms

LuckPerms

905k Downloads

Calls to static methods in Java interfaces are prohibited in JVM target 1.6

Kruemmelspalter opened this issue ยท 4 comments

commented

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

  1. Make a plugin with Kotlin
  2. try to set a permission / build a PermissionNode with `PermissionNode.builder([...]).build()

Expected behaviour

It works

Environment details

  • Server type/version: Spigot running version 1.15.2 build git-Spigot-a99063f-be6aaf0
  • LuckPerms version: v5.2.96

Any other relevant details

commented

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>
commented

I did that and it still doesn't work
Also, IntelliJ says that the sourceCompatibility / targetCompatibility statements aren't used

commented

Please use StackOverflow to ask "how-to" and "why-didn't-it-work" questions.

Or GoogleSearch

commented

Ok I got it working, for kotlin, I have to do

compileKotlin {
    kotlinOptions.jvmTarget = "1.8"
}