Quick revision
The short answer
Each step answered the main pain of the step before. Application servers centralised expensive resources but tied the release cycles of many applications together; executable jars made each service self-contained and easy to run; containers standardised packaging across languages and made orchestration possible; and native images and start-up work answer elastic, short-lived workloads where seconds of start-up and hundreds of megabytes matter. Next I would expect more optimisation at build time and stronger supply-chain controls, and I would keep our own code independent of any one packaging mode so we can move again.
What to remember
In this answer, we read Java deployment as a series of responses to the previous step's main pain. Application servers centralised resources but coupled releases; executable jars made each service self-contained; containers standardised packaging across languages and enabled orchestration; and native images with start-up optimisations answered elastic, short-lived workloads. Looking forward, we expect more build-time optimisation and stronger supply-chain controls, and we stay ready by keeping our code independent of any single packaging mode.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Each step answered the main pain of the step before. Application servers centralised expensive resources but tied the release cycles of many applications together; executable jars made each service self-contained and easy to run; containers standardised packaging across languages and made orchestration possible; and native images and start-up work answer elastic, short-lived workloads where seconds of start-up and hundreds of megabytes matter. Next I would expect more optimisation at build time and stronger supply-chain controls, and I would keep our own code independent of any one packaging mode so we can move again.
Background to this question
Senior engineers are expected to explain not only how things work but why they changed, because the same forces will drive the next change and the organisation has to place bets on it. This question asks us to read twenty years of Java deployment as a series of trade-offs. In this answer, we will go through the era of application servers and EARs, the move to executable jars, the move to containers and orchestration, the rise of native images and start-up optimisation, and then what we can expect next and how to stay ready for it without guessing exactly.
1Application Servers and EARs: Sharing Was the Point
In the early 2000s, a server was an expensive machine, and a JVM with its memory and threads was expensive too. Application servers such as WebLogic, WebSphere and JBoss let many applications share one JVM and one set of resources: connection pools defined once as JNDI datasources, transactions coordinated by the server, security realms, messaging and clustering. An application was packaged as a war or an EAR (Enterprise Archive, a bundle of several modules) and deployed into the server, which provided much of what it needed.
The cost of this sharing appeared over time. Every application on the server had to use the same Java version, the same server version and the same shared libraries, so upgrading one meant testing all of them. Releases were coordinated through an operations team, often monthly, and a memory leak in one application could take down the others. Configuration lived partly in the server console, so the application on its own was not a complete, reproducible unit. In short, sharing resources had coupled the release cycles of many teams.
2Executable Jars: Each Service Brings Its Own Server
By the 2010s, hardware and virtual machines were cheap, and teams wanted to release independently, many times a week. Embedding the server inside the application flipped the model: Spring Boot, Dropwizard and similar frameworks packaged the application, its libraries and an embedded Tomcat, Jetty or Undertow into one executable jar started with java -jar. The application chose its own Java version and libraries, carried its configuration with it, and could be run the same way on a laptop and in production.
This fitted the move to microservices: small services owned by small teams, each deployed on its own schedule. The cost moved elsewhere. Every service now had its own copy of everything, and operations had to manage many processes, each with its own way of being installed, started, monitored and restarted on a VM, usually with configuration management scripts.
3Containers: One Package Format for Everything
Containers solved the operations side of that problem. A container image packages the application together with its runtime, here the JRE, and its operating system libraries into a standard format, the OCI image. To the platform, a Java service, a Go service and a Python job look the same: an image with an entrypoint, resource limits and health checks. That standardisation made orchestration possible: Kubernetes and similar platforms schedule, restart, scale and roll out any image without knowing the language inside.
For Java this brought new work. The JVM had to learn to respect container memory and CPU limits, which it does properly since JDK 10 and the later JDK 8 updates; images had to be built efficiently, which led to layered jars and buildpacks; and security scanning of base images became part of every pipeline. But the gain was large: one deployment model for the whole company.
| Step | Main driver | New cost |
|---|---|---|
| App server + EAR | share scarce hardware and services | coupled releases, shared failures |
| Executable jar | independent releases per team | many processes to operate |
| Container image | one format and orchestration for all | image builds, JVM limits, scanning |
| Native image, AOT | fast start, low memory for elastic loads | build time, reflection limits |
| Next: build-time and supply chain | start-up, cost, provenance | more build complexity |
4Native Images and Start-up Work: Elastic, Short-Lived Workloads
Once services run on orchestrated platforms, they are started and stopped far more often: autoscaling adds instances for a traffic peak, serverless platforms start one per burst of requests, and batch jobs run for seconds. In that world, a JVM that takes 5 seconds to start and 300 MB to warm up is expensive, because every scale-out waits for it and every instance pays for its warm-up.
The response comes in several forms. GraalVM native images compile the application ahead of time into a standalone executable that starts in tens of milliseconds with a fraction of the memory, at the cost of long builds and a closed-world assumption that restricts reflection and dynamic class loading; Spring Boot's AOT processing exists to generate the hints this needs. On the JVM side, class data sharing, CRaC checkpoints and the ahead-of-time cache work of Project Leyden in recent JDKs shorten start-up without giving up the dynamic JVM (check your JDK version for which of these are final).
5What I Would Expect Next, and How to Stay Ready
Two trends look durable to me. The first is more work moving to build time: ahead-of-time caches, pre-computed configuration, trained profiles and smaller runtime images, because start-up and memory translate directly into cost on elastic platforms. The second is supply-chain control: SBOMs (software bills of materials), signed images, provenance attestations and policies at deploy time that check where an artefact came from, driven by both attacks and regulation.
I would not bet the codebase on one packaging mode, though. Each step above lasted around five to ten years, and the next one will arrive while our code is still running. So I would keep application code free of packaging assumptions: configuration from the environment, standard health endpoints, no reliance on a file system layout, reflection kept within what AOT can describe, and builds that can produce a jar, an image and a native executable from the same source. Then a future change of packaging is a pipeline change, not a rewrite.
- What pain does it remove for us?start-up, cost, security, operations
- Measure on two real servicesstart time, memory, build time
- What does it restrict?reflection, libraries, debugging, tooling
- Worth it for this workload class?YesAdopt for that class, keep othersNoStay, revisit in a year
4 steps in order. Play them, or step through them one at a time.
6Follow-up questions
Are application servers obsolete?
Not entirely. Jakarta EE servers are still used, and some modern runtimes such as Open Liberty or Quarkus blur the line by packaging only the server features an application uses. What has largely gone is the model of many unrelated applications sharing one long-lived server; even Jakarta EE applications now usually run one per container.
Should we move all services to native images?
No. Native images pay off for workloads that start often or must scale from zero, such as functions, CLIs and spiky services. For long-running services that stay up for days, the JIT usually reaches higher peak throughput, the build is faster and debugging is easier. We choose per workload class, and keep code compatible with both where it is cheap to do so.
How do supply-chain controls change packaging?
The package becomes something we must be able to prove things about: what is inside it (an SBOM), who built it and from which source (provenance), and that it was not changed afterwards (a signature). Build systems and buildpacks increasingly produce these automatically, and deploy-time policies reject images without them. This favours standard, centrally owned build paths over hand-written ones.
7Conclusion
In this answer, we read Java deployment as a series of responses to the previous step's main pain. Application servers centralised resources but coupled releases; executable jars made each service self-contained; containers standardised packaging across languages and enabled orchestration; and native images with start-up optimisations answered elastic, short-lived workloads. Looking forward, we expect more build-time optimisation and stronger supply-chain controls, and we stay ready by keeping our code independent of any single packaging mode.
Open with
I see each step as a reaction to the pain of the previous one. Application servers made sense when hardware and JVMs were expensive: many applications shared one server, its connection pools, transactions and security.
Then, if they want more
The price was coupling, because every application had to move to new Java or server versions together, releases were coordinated, and one leak could affect all of them. Executable jars, with Spring Boot and an embedded server, made each service self-contained: it chose its own versions, carried its configuration and started with java -jar, which fitted independent teams and microservices.
But operating hundreds of different processes on VMs was hard, and containers solved that by giving every language one package format, the OCI image, which made orchestration with Kubernetes possible.
Once instances start and stop all the time, start-up time and memory become cost, so native images, AOT processing, class data sharing and Leyden-style work respond to elastic and short-lived workloads. Next, I expect more optimisation at build time and much stronger supply-chain controls, such as SBOMs, signatures and provenance checked at deploy time.
My practical advice is not to tie application code to one packaging mode: configuration from the environment, standard health endpoints, AOT-friendly reflection, and a build that can produce a jar, an image or a native executable.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Java 10, Java 8
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Boot reference
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Java deployment went from application servers and EARs to executable jars, containers...": https://scrivio-interview-library.netlify.app/spring-boot/packaging-and-deployment/933c1377cf/