Spring Boot 啓動報錯 Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index

使用命令 java -jar springBoot.jar  啓動項目,結果報錯以下:java

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 37
        at java.lang.String.substring(String.java:1963)
        at org.springframework.boot.loader.jar.JarFile.createJarFileFromDirectoryEntry(JarFile.java:278)
        at org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:258)
        at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:248)
        at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:237)
        at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:103)
        at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:87)
        at org.springframework.boot.loader.PropertiesLauncher.addNestedEntries(PropertiesLauncher.java:480)
        at org.springframework.boot.loader.PropertiesLauncher.getClassPathArchives(PropertiesLauncher.java:418)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:49)
        at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:521)

緣由是,Spring Boot項目中,resources目錄中,含有中文的文件夾,因此致使報錯,因此,之後文件夾和文件的命名,必定最好使用英文!!!!spring

相關文章
相關標籤/搜索