Can't use Java libraries
已回答
i am a begginer of kotlin and intellij idea.
when i use java libraries, like JDA, the ide says
"None of the following functions can be called with the arguments supplied.
<init>(String?) defined in net.dv8tion.jda.api.JDABuilder
<init>(AccountType) defined in net.dv8tion.jda.api.JDABuilder"
but a weeks before, i can use that library on the same code.
mycode:
import net.dv8tion.jda.api.JDABuilder
fun main() {
val jda = JDABuilder("token").build().awaitReady()
}
example on the JDA's readme:
JDA jda = new JDABuilder("token").build();
same error is seen in another library written in java.
how to resolve this problem?
请先登录再写评论。
Hello Miraiteya,
First of all, please make sure, that you're using Java 8, not 11 - both as JDK and for Gradle (you can find out specified in IDE preferences).
oh, i changed sdk from java8 to java 11 / 13 few days ago.
change to use java 8, i can run it!
thanks i really appriciate you.
(sorry for my poor english)