Home / Guides

Comparison

Tomcat vs Jetty: Choosing a Servlet Container for Java Web Apps

Both run the same Servlet API, both embed well, and both are free. The differences that matter are namespace support, release branches and what your framework expects.

Figures checked November 2026Sources linked on the page

A balance scale holding a slender violet flask and a wide amethyst bowl, perfectly level

Apache Tomcat

Current
11.0.27
Spec
Servlet 6.1 (Jakarta EE 11)
Min Java
17
License
Apache 2.0

Eclipse Jetty

Current
12.1.14
Spec
Servlet 3.1 to 6.1, both namespaces
Min Java
17
License
EPL 2.0 or Apache 2.0

Tomcat vs Jetty is less of a contest than it was fifteen years ago. Both are mature, both implement the current Servlet specification, both run embedded inside a JAR, and both are free under permissive licenses. The real differences now sit in release strategy, namespace support and framework defaults. This page compares them on current versions, then places WildFly with Undertow, Payara, Open Liberty and GlassFish next to them for the cases where a plain servlet container is not enough.

Figures checked in November 2026.

The short answer

In the jetty vs tomcat question for Spring Boot, the answer is usually Tomcat: if you have no strong reason to change, stay on it. It is the default, it is what most Spring answers and examples assume, and Apache maintains three supported branches. Choose Jetty when one server has to host both javax and jakarta applications, or when you embed an HTTP server into a tool or library and want Jetty's modular design. That covers most of the Tomcat vs Jetty decision. The rest of the page is the detail behind it.

Tomcat vs Jetty at a glance

The table compares the two on facts from each project's own pages.

Feature Apache Tomcat Eclipse Jetty
Current releases 11.0.27, 10.1.61, 9.0.123 12.1.14 and 12.0.40 (both 2026-10-05)
Newest spec Servlet 6.1, Pages 4.0, EL 6.0, WebSocket 2.2 (Jakarta EE 11) in 11.0 Servlet 6.1 (Jakarta EE 11) in 12.1
Spec range per release One spec level per branch (9.0 = Servlet 4.0, 10.1 = 6.0, 11.0 = 6.1) 12.1 runs Servlet 3.1, 4.0, 5.0, 6.0 and 6.1
javax and jakarta Separate branches Both namespaces in one release
Minimum Java (newest branch) 17 17
License Apache License 2.0 Dual: Eclipse Public License 2.0 and Apache License 2.0
Embedded use Yes, the default server in Spring Boot Yes, "easily embedded" per the project; Spring Boot alternative
Spring Boot default Yes (spring-boot-starter-tomcat) No (spring-boot-starter-jetty)
Ended branches 10.0 (2022-10-31), 8.5 (2024-03-31), 8.0 (2018-06-30); 9.0 ends 31 March 2027, followed by 9.1.x until 31 December 2030 9.4, 10 and 11 marked end of life; community support for 10 and 11 ended January 1, 2024

Neither project publishes a memory footprint figure. Jetty describes itself as "highly scalable and memory-efficient," and Tomcat makes no comparable claim on its home page. Treat any megabyte number you find in a blog post as one measurement on one app, not a property of the server.

How they differ in practice

Release model and namespaces

Tomcat ties each branch to one spec level. That is simple to reason about: if you run Tomcat 11, your code uses jakarta.servlet and Servlet 6.1. The cost shows when an organization has a mix of old and new apps, because it needs Tomcat 9 for the javax ones and Tomcat 10.1 or 11 for the rest. With Tomcat 9 support ending on 31 March 2027, that split has a deadline.

Jetty 12 took a different route. Its core HTTP server no longer depends on the Servlet API, and servlet support is layered on top as separate environments for each Jakarta EE level. One Jetty 12.1 installation can therefore serve a Servlet 4.0 javax app and a Servlet 6.1 jakarta app side by side. For teams in the middle of a javax to jakarta migration, that is the strongest argument for Jetty. The servlets and JSP to Jakarta EE guide explains the rename and the migration tools.

Configuration and operations

Standalone Tomcat is configured through server.xml, context.xml and web.xml in its conf folder, and it ships a Manager web app for deploying and reloading WARs. That layout has been stable for many years, so most operations staff and most hosting platforms know it. Azure App Service and AWS Elastic Beanstalk both offer managed Tomcat stacks, and no major platform in the Java hosting comparison offers a managed Jetty stack.

Jetty's standalone distribution is built from modules you enable one by one, which keeps an installation small but asks you to know which modules you need. In embedded use, which is how most people meet it today, Jetty is configured in Java code, and that is where it feels most natural.

Embedded in Spring Boot

In a Spring Boot app, the jetty vs tomcat choice is a dependency swap. The servlet web starter includes Tomcat. To use Jetty instead, exclude spring-boot-starter-tomcat and add spring-boot-starter-jetty. Everything above the servlet container, controllers, filters and Actuator, works the same. A fat JAR with either server deploys the same way, as shown in the guide on how to deploy a Java app.

Undertow and Spring Boot 4

Undertow is the web server inside WildFly, and for years it was the third embedded option in Spring Boot. That changed with Spring Boot 4. The official migration guide states that Spring Boot 4 requires a Servlet 6.1 baseline "with which Undertow is not yet compatible," and that Undertow support is dropped, including the starter. A Spring Boot 3 app that used the Undertow starter has to move to Tomcat or Jetty before it can upgrade, and server settings under server.undertow.* need Tomcat or Jetty equivalents.

Undertow itself is not abandoned. Standalone 2.4.1.Final came out in May 2026, and WildFly 42 runs on it. The undertow.io home page still says "Servlet 4.0," which is out of date, and no official page confirms the servlet level of the 2.4 line. If you depend on standalone Undertow, check the release notes rather than the home page.

Full application servers

A servlet container runs servlets, filters and JSPs. An application server adds the rest of Jakarta EE: CDI, JPA, JAX-RS, messaging, transactions and more, all provided by the server. You need one only if your code expects those APIs from the platform instead of bundling its own libraries.

Server Current release Spec level Minimum Java Notes
WildFly 42.0.0.Final (2026-10-22) Jakarta EE 11 Platform, Web Profile and Core Profile; MicroProfile 7.1 17 Uses Undertow; compatible with EE 11 on Java SE 17 and 21; recommended JDK is 25
Payara Server 7 Community 7.2026.10 (2026-10-14) Jakarta EE 11, MicroProfile 7.1 not stated Monthly releases; Payara acquired by Azul (announced December 10, 2025)
Open Liberty 26.0.0.11 (2026-11-03) Servlet 6.1 feature (Jakarta EE 11) not stated Releases roughly every four weeks
Eclipse GlassFish 8.0.5 (2026-10-04) Full Jakarta EE 11 compliance 21 7.x line still receives releases; 9.0.0-M3 milestone out

WildFly is the usual open-source pick when a team wants a full server with a long track record. Open Liberty suits containers well because you enable only the features you use. GlassFish, once the reference implementation of Java EE, now lives at the Eclipse Foundation and tracks the newest specs closely. Payara grew out of GlassFish and is now part of Azul, which matters if you want a single vendor for both the JDK and the server.

Which servlet container to pick

A new Spring Boot app. Tomcat, the default. Switch to Jetty only for a concrete reason, for example a library that already depends on Jetty.

A legacy javax WAR that cannot be migrated yet. Tomcat 9 (9.0.x until 31 March 2027, then 9.1.x until the end of 2030), or Jetty 12.1 if you want one server that can also host the migrated version later.

A mix of old and new apps on one server. Jetty 12.1, because it runs Servlet 3.1 through 6.1 in both namespaces.

An HTTP server embedded in a tool, test harness or library. Jetty, built for embedding and configured in code.

Code that uses CDI, JPA or EJB from the platform. An application server: WildFly, Open Liberty, Payara or GlassFish, all at Jakarta EE 11.

A managed platform that runs the container for you. Tomcat, since that is what Azure App Service and Elastic Beanstalk offer. The JDK underneath still matters, and the Java versions page lists how long each LTS release gets updates.

A Spring Boot 3 app on Undertow. Plan the move to Tomcat or Jetty now, because the Spring Boot 4 upgrade will not take Undertow with it.

Sources

  1. tomcat.apache.org/whichversion.html
  2. tomcat.apache.org
  3. tomcat.apache.org/tomcat-9.0.x-eos.html
  4. jetty.org
  5. jetty.org/download.html
  6. github.com/jetty/jetty.project/releases
  7. docs.spring.io/spring-boot/how-to/webserver.html
  8. github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide
  9. wildfly.org/news/2026/10/22/WildFly-42-is-released
  10. github.com/undertow-io/undertow/releases
  11. github.com/payara/Payara/releases/tag/payara-server-7.2026.10
  12. azul.com/company/payara-acquisition
  13. openliberty.io/docs/latest/reference/feature/servlet-6.1.html
  14. glassfish.org
  15. jakarta.ee/specifications/servlet

Guides / FAQ

Good questions.
Clear answers.

Is Jetty faster than Tomcat?

Neither project publishes a benchmark that settles it, and results depend heavily on the app, the connector settings and the JDK. For typical web apps the database and the framework cost more time than the container. Pick on features, namespace support and team familiarity, then measure your own app on both if latency really matters.

Which servlet container does Spring Boot use by default?

Tomcat. The servlet web starter pulls in spring-boot-starter-tomcat. To switch, exclude that starter and add spring-boot-starter-jetty, which the Spring Boot documentation shows for both Maven and Gradle. Spring Boot 4 no longer supports Undertow as an embedded server.

Can Jetty run old javax and new jakarta apps at the same time?

Yes. Jetty 12.1 supports Servlet 3.1, 4.0, 5.0, 6.0 and 6.1, covering Jakarta EE 8 through EE 11 in both namespaces. Tomcat needs separate branches for that: 9.0 for javax, 10.1 or 11 for jakarta.

What happened to Undertow?

Undertow is still developed and is the web layer inside WildFly. Spring Boot 4 dropped its Undertow starter because Spring Boot 4 requires Servlet 6.1 and Undertow is not yet compatible with it. Standalone Undertow 2.4.1.Final was released in May 2026.

Do I need a full application server instead of a servlet container?

Only if you use Jakarta EE APIs beyond servlets, such as CDI, JPA, JMS or EJB, and want the server to provide them. Spring Boot apps bring their own libraries and only need a servlet container. WildFly, Payara, Open Liberty and GlassFish are the full Jakarta EE 11 options.

Find your next step.