Fatal error: com.oracle.svm.core.util.VMError$HostedError: The classpath of com.oracle.svm.hosted.NativeImageGeneratorRunner must not contain ".". This can happen implicitly if the builder runs exclusively on the --module-path but specifies the com.oracle.svm.hosted.NativeImageGeneratorRunner main class without --module.
at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:68)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageClassLoaderSupport.<init>(NativeImageClassLoaderSupport.java:133)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.installNativeImageClassLoader(NativeImageGeneratorRunner.java:180)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:123)
Error: Image build request failed with exit status 1
这个错误的意思就是在环境变量存在了'.',只要把'.'去掉就行了,我一开始只看了%JAVA_HOME%和PATH的变量值,没找到,最后是在classpath中找到的,我不太清楚程序运行时扫描环境变量的机制(是每个都要扫描查看吗?),所有我建议把每个都看看。
我的classpath里面一开始是这样的,就是这个红色框框圈起来的地方。
希望能帮助到大家。