• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple JVM in same machine

 
Mohd Fuzail
Ranch Hand
Posts: 107
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If we run two java application on same machine, will both of them will be having differrent JVM?

If we are having two instances of ecllipse running on same machine, each of them are having their own JVM or they are sharing one JVM ?

Please direct me the link where i can find more information about this issue
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Each instance of the program "java.exe" on Windows is a separate JVM. If you start any two Java-based processes on your computer, they will each be running in their own JVM , whether they be Eclipse or anything else.

Hopefully this is enough information for you; I can't imagine what sort of link would provide any more information than that.

Moving to Java in General (Beginner).
 
Mohd Fuzail
Ranch Hand
Posts: 107
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ernest for the information.

Can provide any online tutorial link or specification which talks in details about multiple JVM
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mohd Fuzail:

Can provide any online tutorial link or specification which talks in details about multiple JVM


If you have some specific question, just ask it, please. But there is no such thing as "an online tutorial about multiple JVM."
 
Mohd Fuzail
Ranch Hand
Posts: 107
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did my SCJP way back in 2001 and i was surprised to know that this multiple JVM issue i never read or encountered till date

So i was wondering if some book or specification talks about each java.exe program invoking and running in it's own JVM

Sorry for streching the issue, but i need to read and go in details about this issue
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What issues? What details? What did you expect your SCJP study materials to go into?

If there's some specific question you have, please ask it. But there is no "SCJP Guide to Multiple JVMs" any more than there is an "SCJP Guide to Spelling 'int'." Once you know the answer, you know it -- there's nothing more to it!
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12015
24
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are you trying to have two different VERSIONS of java on your pc at the same time?

or do you simply want to have two JVMs running at the same time? the second is easy. go to your command prompt and type "java <class>", which will start up a JVM and your program.

then, while that program is running, type "java <class>", and start another program running. this will then start up a second JVM. you will then have two JVMs running until one of your apps shuts down.
 
Abhineet Kapil
Ranch Hand
Posts: 52
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a question on that...


When we need to call a method of ObjectB in Jvm2 from a client ClassA which is in another jvm Jvm1.. We need to use RMI ...

Does the same apply to 2 Jvms running in the same machine and sharing same memory (RAM)..

Can we create sample RMI code and test it on the same machine ??
 
Campbell Ritchie
Sheriff
Pie
Posts: 47229
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two JVMs cannot run and share memory. Each has its own heap, in different areas of RAM.
You would need to use sockets, multiple agents, RMI or similar to access code on different JVMs. You can try it out with two JVMs on the same machine, yes.
 
Abhineet Kapil
Ranch Hand
Posts: 52
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Campbell..

Can you please help with some basic material/link on this subject.

I want to write a simple class object in one jvm calling the method of another object in another jvm .. Both Jvms are on the same machine..

Thanks ..
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could start by googling for something like java rmi tutorial.
 
Abhineet Kapil
Ranch Hand
Posts: 52
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeff ..

Will follow that...
 
Campbell Ritchie
Sheriff
Pie
Posts: 47229
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeff Verdegan wrote:You could start by googling for something like java rmi tutorial.
You might find something here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic