What triggers the JVM thread?

(Please correct me if I am wrong)

I understand that when you run a java program by issuing a java command,

java MyProg

the program will be launched on the new JVM.

  • What loads the program into the new JVM? is it a 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 already asked a question about how to use JMX to send requests to a Java program running locally. I found out that if JMX commands are issued locally, I don't need a port number. The answer was that the client application (for example, jconsole, jvisualvm, jprobe, etc.) is looking for java applications running on the machine. This is fine, but on the condition that the client application will work in another JVM from an application that it wants to control or say how exactly they interact with each other without a port number (since they do not work on the same JVM)?

  • If two programs work, there will usually be 2 JVMs. Do JVMs work in the same JRE process? And does this also mean that two JVMs should be able to communicate?

thank

+3
3
  • ( , ) JVM, Class Class. ( ). JVM ( bootstrap), .
  • , RPC IPC ( ).
  • , .
  • JVM - . . (, , JRE. Firefox, Emacs ).
+6

jvms:

  • ObjectInputStream, ObjectOutputStream

  • RMI

+2

. java - , JVM. java (, ), , JVM. IPC , .

+2

Source: https://habr.com/ru/post/1772644/


All Articles