I have a Java 8 application running on a remote Linux server and need to attach a JConsole to it for debugging purposes.
From my local machine I set up a tunnel to the remote machine:
ssh -fN -L 9999:localhost:9999 myuser@1.11.11.111
On the remote machine I run the application with the following system properties:
java -Dcom.sun.management.jmxremote.port=9999 \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.local.only=false \
-cp foo.jar:config com.foo.bar.Main config/blah.properties
but when I start the JConsole I get Secure connection failed.
If I click on "Insecure connection" I get
How can I get around this?