kukume / kukubot

A bot.
183 stars 36 forks source link

AdoptOpenJDK 11 报错 #42

Closed SekiBetu closed 3 years ago

SekiBetu commented 3 years ago
sekibetu@debian:~/kukubot$ java -jar kukubot-1.0-SNAPSHOT-all.jar 
2021-04-03 02:26:16,531 INFO  c.I.Y.d.ConfigManager@[main] - ConfigManager Init.
2021-04-03 02:26:16,690 INFO  c.I.Y.d.ConfigManager@[main] - ConfigManager Config Mode: dev.
2021-04-03 02:26:16,909 INFO  c.I.Y.d.ConfigManager@[main] - ConfigManager Init Success.
java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at me.kuku.yuq.Start.main(Start.java:57)
Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at com.icecreamqaq.yuq.YuQStarter$Companion.start(YuQStarter.kt:31)
        at com.icecreamqaq.yuq.YuQStarter.start(YuQStarter.kt)
        ... 5 more
Caused by: java.lang.NoClassDefFoundError: javafx/beans/value/ChangeListener
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:878)
        at com.IceCreamQAQ.Yu.loader.AppClassloader.loadAppClass(AppClassloader.java:107)
        at com.IceCreamQAQ.Yu.loader.AppClassloader.loadClass(AppClassloader.java:70)
        at com.IceCreamQAQ.Yu.loader.AppClassloader.loadClass(AppClassloader.java:58)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        at com.IceCreamQAQ.Yu.loader.AppLoader.getClasses(AppLoader.kt:188)
        at com.IceCreamQAQ.Yu.loader.AppLoader.load(AppLoader.kt:50)
        at com.IceCreamQAQ.Yu.DefaultApp.start(DefaultApp.kt:47)
        ... 11 more
Caused by: java.lang.ClassNotFoundException: javafx.beans.value.ChangeListener
        at java.base/java.lang.ClassLoader.findClass(ClassLoader.java:719)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        at com.IceCreamQAQ.Yu.loader.AppClassloader.loadClass(AppClassloader.java:68)
        at com.IceCreamQAQ.Yu.loader.AppClassloader.loadClass(AppClassloader.java:58)
        at java.base/j
sekibetu@debian:~/kukubot$ java -version
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.10+9, mixed mode)

https://file.kuku.me/kuku-bot/2021-04-02/kukubot-1.0-SNAPSHOT-all.jar

kukume commented 3 years ago

请使用oracle jdk8

或者使用我文件站的压缩包运行,里面自带了oracle jdk8

SekiBetu commented 3 years ago

请使用oracle jdk8

或者使用我文件站的压缩包运行,里面自带了oracle jdk8

还是希望改下代码吧,把InvocationTargetException这个异常捕获一下,因为oracle的jdk有商业使用的一些条条规规,不太适合个人使用

kukume commented 3 years ago

是我用的框架只支持oracle jdk8

kukume commented 3 years ago

或者你可以手动往你的openjdk中引入javafx。但是YuQ-mirai只支持jdk8,所以你可以使用openjdk8+手动引入javafx

SekiBetu commented 3 years ago

或者你可以手动往你的openjdk中引入javafx。但是YuQ-mirai只支持jdk8,所以你可以使用openjdk8+手动引入javafx

使用了Liberica JDK11(内含javafx)后依旧报错,不觉得是javafx的问题

编辑:改成了Liberica JDK8后可以了,所以我认为是没适配java11? 因为服务器上有别的程序要用到java11,我还是先观望观望这个机器人的后续开发吧

kukume commented 3 years ago

但是YuQ-mirai只支持jdk8

IceCream-QAQ commented 3 years ago

服务器上有别的称需要用到 Java 11 不影响你这个程序使用 Java8。 Java 又不是只能装一个。