Interview questions
Question 171 of 254
FreeWhat is inside a Spring Boot executable jar, and how does `java -jar app.jar` actually run it?
Deployment & Production
A Spring Boot repackaged jar contains your compiled application classes under `BOOT-INF/classes`, all dependency jars nested (not flattened) under `BOOT-INF/lib`, and a special `org.springframework.boot.loader.JarLauncher` as its main class. Running `java -jar` invokes JarLauncher, which sets up a custom classloader capable of loading classes directly from those nested jars, then hands off control to your actual `@SpringBootApplication` main method — solving the 'jars can't nest inside jars' limitation of the standard JVM classloader.
Advanced7 min

