Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running multiple JVMs

Tags:

java

jvm

How do you run multiple JVMs on a single machine? How do you call methods in a different JVM?

like image 277
giri Avatar asked Jan 08 '10 19:01

giri


2 Answers

It sounds like your talking about having different methods within a single application run under different JVMs. This is not possible.

If you want to use different JVMs for different applications, you'll have to manually specify the path to the particular JRE when you start an app. Example:

$PATH_TO_FIRST_JVM/bin/java -jar application1.jar
$PATH_TO_DIFFERNT_JVM/bin/java -jar application2.jar
like image 78
Jason Nichols Avatar answered Oct 20 '22 10:10

Jason Nichols


How do you run multiple JVMs on a single machine?

Just launch multiple java processes.

How do you call methods in a different JVM?

Use any type of RPC framework (RMI, EJB, web service, etc.).

like image 38
Pascal Thivent Avatar answered Oct 20 '22 10:10

Pascal Thivent