Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JRE and JVM interview Question ....

 
sunil choudhary
Ranch Hand
Posts: 143
Java Redhat Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was asked the difference between the two...
I said..that JRE can stand alone run the java applications in case of Resource shortages.. and can function without JVM also..

Can some one add some more things to this aspect....
Please
.....
Sunil
 
rani bedi
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JRE (Java Runtime Environment) is the equivalent of a JVM but for running applications outside of a browser (like from the DOS prompt).
When you run an applet or servlet it is running in a JVM (Java Virtual Machine). It is actually a set of specifications that Sun gives to the makers of browsers to follow when creating their JVMs.
 
sunil choudhary
Ranch Hand
Posts: 143
Java Redhat Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so parmeet
Does that mean that when I compile a program from Dos prompt then I am just using the JRE and not JVM ..are they really separate or just a subset...
thanks for your reply..
Sunil Choudhary

 
Scott Pedigo
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JRE is a product from Sun which has a JVM in it.
A JVM is an implementation of Sun's specifications for something - could be hardware, could be software, could be a browser - which interprets the Java byte code, executing it on a platform.
 
sunil choudhary
Ranch Hand
Posts: 143
Java Redhat Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Scott
I got the point...
Sunil
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually the SDK has the JRE in it.
If you compile from the prompt you are using the SDK. If you run from the prompt you are using the JRE.
 
sunil choudhary
Ranch Hand
Posts: 143
Java Redhat Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Cindy
Sunil Choudhary
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic