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

JRE and JDK

 
Shailja Sheetal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am into Java programming since few years but still have a small confusion. JDK has utilities for compiling and executing java programs i.e. javac and java then why we need JRE? Does JRE need to be there for providing JVM only? I have found that JRE interprets byte code into machine specific code and thereby executes them , I understand that the same thing is done by java.exe launcher. ISnt it?
 
Campbell Ritchie
Sheriff
Pie
Posts: 48968
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

I think you have worked out the answer already.

The JRE is used by applications which simply execute Java programming (Applets on web pages, for example). All the components of the JRE are in the JDK too, but the JDK has compilers etc, so you can use it to create new applications.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12126
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JRE is the Java Runtime Environment. It's everything you need to RUN a java program that has been converted to bytecode.

The JDK is the Java Development Kit. It has everything you need to write, compile and run a java program.

the JRE is effectivly a subset of the JDK.
 
rohit leeta
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And JDK also contains a JRE. I guess that is the cause of confusion in your mind. You saw java.exe under JDK's bin?
 
Shailja Sheetal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank yoo all for responding. Yes I found JRE in JDK and JDK too has its own tools for execution of a Java Program, so I thought why is JRE needed. Now I understand that if one has bytecode then one just needs to have JRE on his machine to execute them.Thank you all once again
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic