Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Defautl Port For JVM?  RSS feed

 
ranua agarwal
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is there any api/command to get the port for running jvm on local machine?
What is the default port for the JVM?

Thanks,
Ranu.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean with the "port for the JVM"? Do you mean a TCP/IP port number? As far as I know, the JVM does by default not listen on any network ports.
 
ranua agarwal
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jasper,

I am writting code for JMX to fetch CPU utilization.
To connect with remote machine, we need to pass the "url" to
JMXConnector, in this form--
JMXServiceURL url = new JMXServiceURL(
"service:jmx:rmi:///jndi/rmi://102.57.63.10:8686/jmxrmi");

Here 8686 is the port for jvm, and thus i asked the qyestion.
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html
 
Henry Wong
author
Sheriff
Posts: 23283
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

By default, for the JVM, JMX connectors are *not* turned on -- so the "default" port of the JMX connector will depend on how you turned it on (which may also depend on what JMX implementation you are using).

Henry
 
Campbell Ritchie
Marshal
Posts: 55724
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a "beginning" question. Moving thread.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!