(Please correct me if i am wrong)
I understand that when you run a java program by issuing the java command,
java MyProg
the program will be run onto a new JVM.
What loads the program into a new JVM? is it the JRE that spawns a new thread?
If each program runs in its own JVM, is it possible for them to communicate with each other?
I asked a question earlier on how to use JMX to send requests to a java program running locally. I found out that if the JMX commands are issued locally i dont need a port number. The answer was that the client application (e.g. jconsole, jvisualvm, jprobe etc) searches for java applications running on the machine. This is fine but given that the client application will run in a different JVM from the application it wants to monitor or talk to, how exactly do they interface with each other without a port number (since they are not running on the same JVM)?
If two programs are running there will usually be 2 JVMs. Do the JVMs run within the same JRE process? And also wouldnt this mean that the two JVMs should be able to communicate?
Thanks