From ae619f4ae17a6bb043e4338ad67f4c9471e5f139 Mon Sep 17 00:00:00 2001 From: cs_xuhuan Date: Tue, 3 Nov 2026 01:32:48 +0800 Subject: [PATCH 1/2] docs: explain how to identify JBang applications in VisualVM --- docs/modules/ROOT/pages/running.adoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/modules/ROOT/pages/running.adoc b/docs/modules/ROOT/pages/running.adoc index 965831e859..a9eb4d66fd 100644 --- a/docs/modules/ROOT/pages/running.adoc +++ b/docs/modules/ROOT/pages/running.adoc @@ -58,6 +58,19 @@ by the filename and then added `maxage=24h` to flight recording options. If you want further control use `//COMPILE_OPTIONS -XX:StartFlightRecording=` instead. +== VisualVM + +To make an application started with JBang easier to identify in https://visualvm.github.io/[VisualVM], +set the `visualvm.display.name` system property when running it: + +[source, bash] +---- +jbang run -Dvisualvm.display.name=My-Java-App myapp.java +---- + +While the application is running, look for `My-Java-App` under *Local* in VisualVM's *Applications* tab. +This also works when running a JAR file: replace `myapp.java` with the path to your JAR. + == `java`, `javac` and `nativeimage` Options You can pass options directly from JBang to the compiler and runtime tools that it uses to build and run your code. From 34dee843a2b7e94b4e4b1b8adc3a13cecf572bc7 Mon Sep 17 00:00:00 2001 From: gelatoni-xh Date: Tue, 3 Nov 2026 01:48:02 +0800 Subject: [PATCH 2/2] docs: use the official VisualVM Applications window term --- docs/modules/ROOT/pages/running.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/ROOT/pages/running.adoc b/docs/modules/ROOT/pages/running.adoc index a9eb4d66fd..a64b769e31 100644 --- a/docs/modules/ROOT/pages/running.adoc +++ b/docs/modules/ROOT/pages/running.adoc @@ -68,7 +68,7 @@ set the `visualvm.display.name` system property when running it: jbang run -Dvisualvm.display.name=My-Java-App myapp.java ---- -While the application is running, look for `My-Java-App` under *Local* in VisualVM's *Applications* tab. +While the application is running, look for `My-Java-App` under *Local* in VisualVM's *Applications* window. This also works when running a JAR file: replace `myapp.java` with the path to your JAR. == `java`, `javac` and `nativeimage` Options