Explore Courses Blog Tutorials Interview Questions
0 votes
in Java by (3.5k points)

How to activate JMX on a JVM for access with jconsole?

1 Answer

0 votes
by (46k points)

The relevant documentation can be found here:

Start your program with following code:

For example like this:

java \ \ \ \ \

  -jar Notepad.jar is not necessarily neededbut without it, it doesn't work on Ubuntu. The error would be something like this:

01 Oct 2008 2:16:22 PM sun.rmi.transport. customer .TCPTransport$AcceptLoop executeAcceptLoop

WARNING: RMI TCP Accept-0: accept loop for ServerSocket[addr=,port=0,localport=37278] throws The server sockets created using the LocalRMIServerSocketFactory only accept connections from clients running on the host where the RMI remote objects have been exported.


    at sun.rmi.transport. customer .TCPTransport$AcceptLoop.executeAcceptLoop(

    at sun.rmi.transport. customer .TCPTransport$



Also be careful with which makes access available for anyone, but if you only use it to track the JVM on your local machine it doesn't matter.

In some cases I was not able to reach the server. This was then fixed if I set this parameter as well: -Djava.rmi.server.hostname=

Related questions

Browse Categories