项目:spring boot+jdk12.0.2
启动项目时报错
20:15:56.754 [main] DEBUG org.springframework.context.event.SimpleApplicationEventMulticaster - Non-matching event type for listener: org.springframework.boot.devtools.restart.RestartApplicationListener@12cdcf4
java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders
A
p
p
C
l
a
s
s
L
o
a
d
e
r
c
a
n
n
o
t
b
e
c
a
s
t
t
o
c
l
a
s
s
j
a
v
a
.
n
e
t
.
U
R
L
C
l
a
s
s
L
o
a
d
e
r
(
j
d
k
.
i
n
t
e
r
n
a
l
.
l
o
a
d
e
r
.
C
l
a
s
s
L
o
a
d
e
r
s
AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders
AppClassLoadercannotbecasttoclassjava.net.URLClassLoader(jdk.internal.loader.ClassLoadersAppClassLoader and java.net.URLClassLoader are in module java.base of loader ‘bootstrap’
原因
老版本的 spring-boot-devtools 与最新版的 JDK之间不兼容。
解决方案:
1.注释掉spring-boot-devtools
2.将jdk版本修改为jdk8.0
注:jdk8.0以下下载需要登录Oracle
账号:2696671285@qq.com
密码:Oracle123
参考文件:
https://blog.csdn.net/qq_44274233/article/details/103737000
springboot启动时出现报错
最新推荐文章于 2023-03-26 22:55:07 发布