I can monitor applications with VisualVM if I use the AdoptOpenJDK HotSpot build for Java8. If I use the OpenJ9 build, VisualVM displays the error "Local applications cannot be detected".
Did anybody get VisualVM to work with OpenJ9?
OpenJ9 is a lot different from HotSpot in monitoring area. So if you want to monitor OpenJ9, you have to use JMX. Start your OpenJ9 with JMX enabled. For simple configuration you can use following system properties:
java -Dcom.sun.management.jmxremote.port=9999 \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false
Start VisualVM on AdoptOpenJDK and add a local JMX connection on the port 9999 - right click on the 'Local' node and select 'Add JMX connection'. Use 'localhost:9999' as a connection string.