Java – jcmd not found?

The jcmd is available at the JDK/bin, not JRE. Make sure the installed Java is JDK, not JRE. Let review the following example, try to use jcmd to enable Java Flight Recorder inside a docker container. 1. DockerFile A simple Dokcerfile. Dockerfile FROM adoptopenjdk/openjdk11:alpine-jre ARG JAR_FILE=target/markdown.jar WORKDIR /opt/app COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-jar","app.jar"] 2. Docker …

Read more