Skip to content

Commit 7cdc754

Browse files
update remote JMX docs with new proxy instructions.
1 parent 9ad216f commit 7cdc754

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/reference-manual/native-image/guides/build-and-run-native-executable-with-remote-jmx.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Make sure you have installed a GraalVM JDK.
3131
The easiest way to get started is with [SDKMAN!](https://sdkman.io/jdks#graal).
3232
For other installation options, visit the [Downloads section](https://www.graalvm.org/downloads/).
3333

34-
1. Save the following code to a file named _SimpleJmx.java_. The application `main()` method registers a custom MBean, then loops endlessly, so you have time to inspect the process using VisualVM.
34+
1. Create and navigate to a directory named _jmx-test_. Save the following code to a file named _SimpleJmx.java_. The application `main()` method registers a custom MBean, then loops endlessly, so you have time to inspect the process using VisualVM.
3535
```java
3636
import javax.management.MBeanServer;
3737
import javax.management.ObjectName;
@@ -79,13 +79,13 @@ For other installation options, visit the [Downloads section](https://www.graalv
7979
}
8080
```
8181

82-
2. Ccompile the application using the GraalVM JDK:
82+
2. Compile the application using the GraalVM JDK:
8383
```shell
8484
javac SimpleJmx.java
8585
```
8686
This creates _SimpleJmx.class_, _SimpleJmx$Simple.class_, and _SimpleJmx$SimpleMBean.class_ files.
8787

88-
3. Add dynamic proxy configuration. JMX uses dynamic proxies, a [dynamic feature](../DynamicFeatures.md) of Java, to access MBeans. To be able to interact with the custom `SimpleMBean` at run time, you need to provide Native Image with additional [dynamic-proxy metadata](../ReachabilityMetadata.md#reflection) for the MBean interface. For this, create or modify a JSON file named _reachability-metadata.json_ with the following contents:
88+
3. Add dynamic proxy configuration. JMX uses dynamic proxies, a [dynamic feature](../DynamicFeatures.md) of Java, to access MBeans. To be able to interact with the custom `SimpleMBean` at run time, you need to provide Native Image with additional [dynamic-proxy metadata](../ReachabilityMetadata.md#reflection) for the MBean interface. For this, create the _META-INF/native-image_ directory in the current working directory (_jmx-test_). In the _META-INF/native-image_ directory create a _reachability-metadata.json_ file with the following contents:
8989
```json
9090
{
9191
"reflection": [
@@ -98,9 +98,9 @@ For other installation options, visit the [Downloads section](https://www.graalv
9898
}
9999
```
100100

101-
4. Build a native executable with the VM inspection enabled and pass the JSON configuration file to `native-image`:
101+
4. Build a native executable with the VM inspection enabled:
102102
```shell
103-
native-image --enable-monitoring=jmxserver,jmxclient,jvmstat -H:DynamicProxyConfigurationFiles=proxy-config.json SimpleJmx
103+
native-image --enable-monitoring=jmxserver,jmxclient,jvmstat SimpleJmx
104104
```
105105

106106
The `--enable-monitoring=jmxserver` option enables the JMX Server feature (to accept incoming connections).

0 commit comments

Comments
 (0)