Spring Boot 啟動報錯 Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 37

來源:互聯網
上載者:User

標籤:項目   direct   launcher   work   str   loader   fbo   creat   main   

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

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 Boot 啟動報錯 Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 37

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.