Tag Archives: Spring Boot Start Error

Spring Boot Start Error: Exception in thread “main” java.lang.StringIndexOutOfBoundsException: …

Start the project with the command Java – jar springboot.jar, and the error is as follows:

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)

The reason is that in the spring boot project, the resources directory contains a Chinese folder, which leads to an error. Therefore, it is best to use English for the naming of folders and files in the future