> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/ix.-how-to-guides/75.-embedded-web-servers/75.8-configure-http2/75.8.3-http2-with-tomcat.md).

# 75.8.3 HTTP/2与Tomcat

默认情况下，Spring Boot提供Tomcat 8.5.x。对于该版本，只有在主机操作系统上安装了`libtcnative`库及其依赖项时，才支持HTTP/2。

必须使库文件夹对JVM库路径可用。你可以使用诸如`-Djava.library.path=/usr/local/opt/tomcat-native/lib`这样的JVM参数来实现这一点。关于这方面的更多信息，请参阅[Tomcat官方文档](https://tomcat.apache.org/tomcat-8.5-doc/apr.html)。 在没有那个本地支持的情况下启动Tomcat 8.5，会记录以下错误：

```
ERROR 8787 --- [           main] o.a.coyote.http11.Http11NioProtocol      : The upgrade handler [org.apache.coyote.http2.Http2Protocol] for [h2] only supports upgrade via ALPN but has been configured for the ["https-jsse-nio-8443"] connector that does not support ALPN.
```

这个错误不是致命的，应用程序仍然使用HTTP/1.1 SSL支持启动。

使用Tomcat 9.0.x与JDK9运行应用程序，不需要安装任何本机库。要使用Tomcat 9，可以覆盖`tomcat.version`构建属性，来使用你选择的版本。
