目录
- springboot项目启动运行main方法报错NoClassDefFoundError
- 先说解决方案
- 总结
springboot项目启动运行main方法报错NoClassDefFoundError
spring boot项目启动的时候 ,运行main方法报错如下:NoClassDefFoundError
Connected to the target VM, address: '127.0.0.1:58203', transport: 'socket'
Exception in thread "main" Java.lang.NoClassDefFoundEjavascriptrror: org/springframework/boot/SprjavascriptingApplication at 编程客栈com.xxx.IndstApp.main(IndstApp.java:17)Caused by: java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jwww.devze.comdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 1 moreDisconnected from the target VM, address: '127.0.0.1:58203', transport: 'socket'Process finished with exit code 1
项目代码编译没错,运行的时候android报错 NoClassDefFoundError ,这是什么鬼!!
先说解决方案
找到Edit Configurations
Application选项,Shorten command line
切换一下
Application选项,Shorten command line
切换一下,改成 JAR mainifest, 然后重新rebuild 项目, 运行成功!!
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持编程客栈(www.devze.com)。
精彩评论