Skip to content

Commit a2b0fe7

Browse files
authored
Add Prerequisites to README (#21)
1 parent deda59c commit a2b0fe7

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,25 @@ On Windows, the plugin will refuse to install unless the binary has the `.exe` f
4242

4343
## Usage
4444

45+
### Prerequisites
46+
This plugin internally uses `jmap` for OpenJDK-like Java virtual machines. When using the [Cloud Foundry Java Buildpack](https://github.com/cloudfoundry/java-buildpack), `jmap` is no longer shipped by default in order to meet the legal obligations of the Cloud Foundry Foundation.
47+
To ensure that `jmap` is available in the container of your application, you have to explicitly request a full JDK in your application manifest via the `JBP_CONFIG_OPEN_JDK_JRE` environment variable. This could be done like this:
48+
49+
```yaml
50+
---
51+
applications:
52+
- name: <APP_NAME>
53+
memory: 1G
54+
path: <PATH_TO_BUILD_ARTIFACT>
55+
buildpack: https://github.com/cloudfoundry/java-buildpack
56+
env:
57+
JBP_CONFIG_OPEN_JDK_JRE: '{ jre: { repository_root: "https://java-buildpack.cloudfoundry.org/openjdk-jdk/bionic/x86_64", version: 11.+ } }'
58+
```
59+
Please note that this requires the use of an online buildpack (configured in the `buildpack` property). When system buildpacks are used, staging will fail with cache issues, because the system buildpacks don’t have the JDK chached.
60+
Please also note that this is not to be considered a recommendation to use a full JDK. It's just one option to get the tools required for the use of this plugin when you need it, e.g., for troubleshooting.
61+
The `version` property is optional and can be used to request a specific Java version.
62+
63+
### Commands
4564
<pre>
4665
NAME:
4766
java - Obtain a heap dump or thread dump from a running, Diego-enabled, SSH-enabled Java application
@@ -57,10 +76,13 @@ OPTIONS:
5776

5877
The heap dump or thread dump (depending on what you execute) will be outputted to `std-out`.
5978
You may want to redirect the command's output to file, e.g., by executing:
60-
`cf java heap-dump [my_app] -i [my_instance_index] > heap-dump.hprof`
79+
80+
```shell
81+
cf java heap-dump [my_app] -i [my_instance_index] > heap-dump.hprof
82+
```
6183

6284
The `-k` flag is invalid when invoking `cf java thread-dump`.
63-
(Unlike with heap dumps, the JVM does not need to output the threaddump to file before streaming it out.)
85+
(Unlike with heap dumps, the JVM does not need to output the thread dump to file before streaming it out.)
6486

6587
## Limitations
6688

0 commit comments

Comments
 (0)