jQuery in Action, 2nd edition*
The moose likes Distributed Java and the fly likes Defautl Port For JVM? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Defautl Port For JVM?" Watch "Defautl Port For JVM?" New topic
Author

Defautl Port For JVM?

ranua agarwal
Greenhorn

Joined: Mar 31, 2010
Posts: 25
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
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14193
    
  20

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.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
ranua agarwal
Greenhorn

Joined: Mar 31, 2010
Posts: 25
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

Joined: Oct 27, 2005
Posts: 19697
    
  20

Check http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18874
    
  40


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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39044
    
  23
Not a "beginning" question. Moving thread.
 
 
subject: Defautl Port For JVM?