Can't access static file from Spring Boot application running in Tomcat servlet
问题 All I want to do is access a specific file in a Java class. I am using Spring Boot 2.0.0.M7. When I run from my development machine using mvn spring-boot:run then everything works well. In that case I am using: File jFile = new File("src/main/resources/static/folder/fileName.txt"); When I deploy this to a Tomcat server (8.5) as a war, the file is put into: WEB-INF/classes/static/folder/fileName.txt I've tried everything I could find or think of, but always get an error of some sort, usually a