Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can multiple java applications run under same VM?

Tags:

java

jvm

I am running two different java applications and both are running of different JVMs. Actually I need to pass some data between these applications, I am already using shared file approach here but looking for more better approach.

So what I am thinking is that if somehow we are able to run these apps under same JVM and then may we can pass data between these apps. I don't know how can we pass data between apps running under same JVM.

like image 802
SmartSolution Avatar asked Nov 24 '25 23:11

SmartSolution


2 Answers

The technology of data transfer between 2 application is the RMI in Java, I think you should use that.

Here is an introduction for this: Introduction to Java RMI

like image 147
Csujo Avatar answered Nov 27 '25 12:11

Csujo


You can implement your apps contact to each other through Socket.

like image 30
Genzer Avatar answered Nov 27 '25 11:11

Genzer