vscode在win10上NoClassDefFoundError

在win10环境下,使用vscode编程,
vscode在win10上NoClassDefFoundError_第1张图片
在运行main方法的时候,发生NoClassDefFoundError异常

PS D:\javaworkspace\test>  & 'D:\jdk-17.0.2\bin\java.exe' '-XX:+ShowCodeDetailsInExceptionMessages' '@C:\Users\天安门\AppData\Local\Temp\cp_a55ai080369r3mslb8nj7xy8t.argfile' 'com.example.test.TestApplication'
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication
        at com.example.test.TestApplication.main(TestApplication.java:10)
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication       
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
        ... 1 more
PS D:\javaworkspace\test>

打开cp_a55ai080369r3mslb8nj7xy8t.argfile看看

-cp "D:\\javaworkspace\\test\\target\\classes;C:\\Users\\天安门
\\.m2\\repository\\org\\springframework\\boot\\spring-boot-
starter\\2.6.3\\spring-boot-starter-2.6.3.jar"

其原因呢, 就是因为路径里面有中文名称,把"天安门"换成英文,问题解决。

你可能感兴趣的:(java)