70.16 Use Tomcat 7.x or 8.0
Tomcat 7 & 8.0 work with Spring Boot, but the default is to use Tomcat 8.5. If you cannot use Tomcat 8.5 (for example, because you are using Java 1.6) you will need to change your classpath to reference a different version.
70.16.1 Use Tomcat 7.x or 8.0 with Maven
If you are using the starters and parent you can change the Tomcat version property and additionally import tomcat-juli
. E.g. for a simple webapp or service:
<properties> <tomcat.version>7.0.59</tomcat.version> </properties> <dependencies> ... <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat-juli</artifactId> <version>${tomcat.version}</version> </dependency> ... </dependencies>
70.16.2 Use Tomcat 7.x or 8.0 with Gradle
With Gradle, you can change the Tomcat version by setting the tomcat.version
property and then additionally include tomcat-juli
:
ext['tomcat.version'] = '7.0.59' dependencies { compile 'org.springframework.boot:spring-boot-starter-web' compile group:'org.apache.tomcat', name:'tomcat-juli', version:property('tomcat.version') }