Idea taken from:
Connecting Through Firewall Using JMX – Without modifying the server applicationto use agent execute:
java -Djmx.host=<DESIRED_HOSTNAME> -Djmx.port=<DESIRED_PORT> -javaagent:<PATH_TO_AGENT_JAR> ...
Example (tunneling friendly):
java -Djmx.port=22000 -Djava.rmi.server.hostname=localhost -javaagent:jmx-firewall-friendly-agent-1.0-SNAPSHOT.jar ...
You should use this URL then (after tunneling chosen port):
service:jmx:rmi://localhost:22000/jndi/rmi://localhost:22000/jmxrmi