Skip to content

Commit 2a20ceb

Browse files
committed
Fix CDS link and clarify where and when to run the commands
Closes gh-41321
1 parent 8000754 commit 2a20ceb

File tree

1 file changed

+11
-3
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/packaging

1 file changed

+11
-3
lines changed

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/packaging/efficient.adoc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,30 @@
44

55

66
[[packaging.efficient.unpacking]]
7-
== Unpacking the Executable JAR
7+
== Unpacking the Executable jar
88

99
You can run your application using the executable jar, but loading the classes from nested jars has a small startup cost.
1010
Depending on the size of the jar, running the application from an exploded structure is faster and recommended in production.
1111
Certain PaaS implementations may also choose to extract archives before they run.
1212
For example, Cloud Foundry operates this way.
1313

1414
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].
1616

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
1818
contains the application classes and a manifest which references the libraries in the `lib/` folder.
1919

20+
To unpack the executable jar, run this command:
21+
2022
[source,shell]
2123
----
2224
$ 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+
----
2331
$ java -jar my-app/my-app.jar
2432
----
2533

0 commit comments

Comments
 (0)