File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/packaging Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 4
4
5
5
6
6
[[packaging.efficient.unpacking]]
7
- == Unpacking the Executable JAR
7
+ == Unpacking the Executable jar
8
8
9
9
You can run your application using the executable jar, but loading the classes from nested jars has a small startup cost.
10
10
Depending on the size of the jar, running the application from an exploded structure is faster and recommended in production.
11
11
Certain PaaS implementations may also choose to extract archives before they run.
12
12
For example, Cloud Foundry operates this way.
13
13
14
14
Spring Boot supports extracting your application to a directory using different layouts.
15
- The default layout is the most efficient, and is xref:#deployment.efficient.cds [CDS friendly].
15
+ The default layout is the most efficient, and is xref:reference:packaging/class-data-sharing.adoc [CDS friendly].
16
16
17
- In this layout, the libraries are extracted to a `lib/` folder, and the application JAR
17
+ In this layout, the libraries are extracted to a `lib/` folder, and the application jar
18
18
contains the application classes and a manifest which references the libraries in the `lib/` folder.
19
19
20
+ To unpack the executable jar, run this command:
21
+
20
22
[source,shell]
21
23
----
22
24
$ java -Djarmode=tools -jar my-app.jar extract
25
+ ----
26
+
27
+ And then in production, you can run the extracted jar:
28
+
29
+ [source,shell]
30
+ ----
23
31
$ java -jar my-app/my-app.jar
24
32
----
25
33
You can’t perform that action at this time.
0 commit comments