How many JVM could be run on an operating system. if only one then what is the logical reason.

Questions by sjehan

Showing Answers 1 - 41 of 41 Answers

Anitha

  • Nov 2nd, 2005
 

one JVM will be consired, since JVM is consider as the JavaByte code interpreter(not specfic to any system o any processor), that will consider the javaprogram and convert in to the Native system call.

  Was this answer useful?  Yes

madhulatha

  • Nov 3rd, 2005
 

Any no of jvms can run on a single operating systems

charles

  • Nov 3rd, 2005
 

Hello friends, I would like to get the questions and answers as a bundle

  Was this answer useful?  Yes

Nihar

  • Nov 3rd, 2005
 

only one jvm could be run on one operating system else ambiguity occurs.

  Was this answer useful?  Yes

panxin

  • Nov 3rd, 2005
 

only one java_home

  Was this answer useful?  Yes

anitha

  • Nov 3rd, 2005
 

how many jvm could be run on an operating system

  Was this answer useful?  Yes

srinivasan

  • Nov 4th, 2005
 

only one

  Was this answer useful?  Yes

srini

  • Nov 4th, 2005
 

more than one JVM can runin single operating system.but the perforamence of os can be reduced

  Was this answer useful?  Yes

meeakshi

  • Nov 6th, 2005
 

JVM is operating system specific.

  Was this answer useful?  Yes

shelim

  • Nov 6th, 2005
 

I think only one JVM can run in one OS,if there is more than one then how classloader will load the class.

  Was this answer useful?  Yes

shelim

  • Nov 6th, 2005
 

only one jvm can run in one os,if not then how classloader load the class if two jvm is there.

  Was this answer useful?  Yes

darn

  • Nov 7th, 2005
 

First try to load more than one JVM whether it is possible or not. then find out ur ans urself.

  Was this answer useful?  Yes

dhaval

  • Nov 7th, 2005
 

yes only one.

multiple are crashes

  Was this answer useful?  Yes

paresh mishra

  • Nov 9th, 2005
 

there is only one operating system in one machine thats why only one JVM reqJVM is nothing but software who manages java application ..if suppose there could be more than one os can be run in one machine then there can be more than one JVM can be also run

  Was this answer useful?  Yes

Sridhar V

  • Nov 9th, 2005
 

only one JVM is enough,i think. because, the work of the JVM is mapping the byte code to machine code of any java program. it can map more than one java program at a same time.so only one JVM is much enough.

  Was this answer useful?  Yes

mandyjoshi

  • Nov 11th, 2005
 

This is difficult question. Let me explain my understanding from RMI prosepctive. RMI says it is used for communicating betwwen distributed JVM that is different JVM. Now consider you have 2 different java processes on same machine but you can not call method of class in one process from other without RMI. So they are diffrent JVM on same machine (At least from RMI definition).

  Was this answer useful?  Yes

anya

  • Nov 14th, 2005
 

Any Number of JVMs can be running.Every JVM that runs is associated with a seperate process.For example, open two cmd prompts and try running 2 different classes.It surely works.In case you use IDE, try running 2 or more instances of the IDE, but in different workspace, Every IDE run is associated with one process.So , several processes can be running at one time instance.Only thing to note is that every time a JVM runs, some part of memory is reserved .i.e If I am not mistaken, the address line for a JVM is 16 bit.So, 2 pow 16 bits of memory is allocated per JVM.

venki

  • Jan 3rd, 2006
 

more than one jvm's cam run on a single system.I can prove this with a piece of code.for a static member of a class memory allocated will be one location per one jvm.

class A{

public static int x=10;

}

public class ex{

public static void main(String args[]){

System.out.println("incr of x" + A.x++ + "again" + A.x++);

}

compile this code and run on different command lines same time,every time u see the same result.against the fact that " for a static member of a class memory allocated will be one location per one jvm ".

Debasish Dutta Roy

  • Jan 16th, 2006
 

Here is a little detailed explanation.1. There can be multiple JVMs exisiting in an operating system.Example, you can install multiple versions of jdk in your machine. 1.3, 1.4, 1.5 etc. All installed in different folders, say c:/jdk1.3, c:/jdk1.4 etc.2. However, when you run a particular program it depends on the JAVA_HOME path that you specify. You can setup one in the env variables and also pass it as an argument to override the value.

  Was this answer useful?  Yes

Ramesh Chowdry

  • Apr 6th, 2006
 

More than one JVM instances can run on os.if you want open more than one command prompts you can run the java programs at the same time.

  Was this answer useful?  Yes

Joseph Kiernan

  • Jul 27th, 2006
 

Many. The second part of the question is meaningless as the issue does not arise.

  Was this answer useful?  Yes

Anup Joy

  • Nov 29th, 2006
 

Any number of JVM's can be installed on a single OS,JVM is simply an environment, which executes the java application, so it will be ultimately the user choice to decide upon which environment he would like to run his application on.( remember :: $ java )By this, the particular JVM is invoked to run the application

  Was this answer useful?  Yes

we can install any number of JVM's in one operating system.But at a time we can run only one since what ever the PATH we specified in environmental variables based on the version it run's.

Here u may ask the question like if we give more than one path's in the PATH variable in enviroment variable.Yes we can give any number of path's i.e see the example below

PATH=C:Program FilesJavajdk1.6.0_03bin;C:Program FilesJavajdk1.5.0_03bin;.

For the above example two jdk's are installed and path's are given for PATH environment variable.But the important thing while the jvm is running first it checks the first path variable it is enough it execute so it don't look for second path.Incase if first path given is not suitable then it look's at second path's variable i.e jdk.1.5 version jvm is executed.

We can run as many JVM instances as we want on an OS. When ever we start a new java process by invoking java.exe (i.e. java [class-name] ) a new instance of JVM is created. Each java process executes in its separate JVM environment - we can specify different JVM parameter for each process.

If it was not possible to execute more than one JVM instance or in other words if all java processes were made share the same JVM instance, then we would not have been able to specify separate JVM options for every processes.

Also, this provides a security feature for each java process, as it executes in its separate environment controlled by the JVM options provided during its start.

A good example of it is Java RMI. RMI is used for communication between two JVMs. Even on a single machine we need to use RMI to communicate between different java processes, that explains that they are not sharing the same JVM instance.

Now, many people are of the opinion that we can have only one JVM as we can install only one JVM type on an OS. This is same as saying that we can open only one MS-Word document coz we can install only one office suit. (Well, not exactly, we can have multiple office suits installed - in different directories).

Also to say, whenever we do a java install, we do not install a JVM, we either install a JRE or JDK. And we can install multiple JRE/JDK on the same machine and also use them simultaniously run our programs - by providing specific paths during program start.

sampra

  • Mar 13th, 2012
 

we can install any number of JVMs in one operating system.But at a time we can run only one since what ever the PATH we specified in environmental variables based on the version it runs.

  Was this answer useful?  Yes

Puli Manoj Kumar

  • Dec 6th, 2014
 

multiple jvms can run on single OS at a time,but performance is low .

if you are already setting jvm path in your system it is automatically set when program is executing.
and your program in save in a specific folder then set Apache tomcat or any server path will set and execute your program then two jvms at a time run

  Was this answer useful?  Yes

Nagarjuna

  • Feb 28th, 2015
 

JVM is a OS level process, If we observe Chrome browser - How many tabs you open those many processes will be created by the operating system. In the same way JRE is also designed to run multiple processes of JVM on top of any Operating System.
PATH system variable is only for the Operating System to find its executable files only. This variable is not specific to Java. :)

  Was this answer useful?  Yes

utkarsh singhal

  • Mar 6th, 2015
 

You can run any number of JVMs on a machine unless and until your machine can provide required resources like RAM to run JVM.
Similarly, you can install any number of JDKs on your machine.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions