Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simultaneously run java programs run on same JVM?

Tags:

java

jvm

Suppose I run two java programs simultaneously on the same machine. Will the programs run in a single instance of JVM or will they run in two different instances of JVM?

like image 268
Deepak B Avatar asked Jun 07 '11 11:06

Deepak B


People also ask

Does each Java application run in its own jvm?

There's one JVM per Java application. There shouldn't be any connection between them unless you establish one, e.g. with networking. If you're working inside of an IDE, the code you write generally runs in a separate JVM. The IDE will typically connect the separate JVM for debugging.

Can two jvm run on same machine?

Yes, you can run multiple JVM's on a single machine.


1 Answers

If you start each one with the java command (from the command line) they will run as totally separate JVMs.

"Programs" may be started as separate Threads running inside the one JVM.

like image 85
Bohemian Avatar answered Sep 18 '22 21:09

Bohemian