This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes JRE and JDK Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JRE and JDK" Watch "JRE and JDK" New topic
Author

JRE and JDK

Shailja Sheetal
Greenhorn

Joined: May 03, 2007
Posts: 4
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

Joined: Oct 13, 2005
Posts: 38075
    
  22
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

Joined: Oct 02, 2003
Posts: 11170
    
  16

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.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
rohit leeta
Ranch Hand

Joined: May 02, 2007
Posts: 49
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?


<a href="http://www.java-forums.org" target="_blank" rel="nofollow">Java Forums</a>
Shailja Sheetal
Greenhorn

Joined: May 03, 2007
Posts: 4
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
 
 
subject: JRE and JDK
 
Similar Threads
ONE QUESTION!
%JavaHome%/jre/lib/ext (JDK) and Javasoft/jre/lib/ext (JRE)?
JRE Question
Difference between JVM and JRE
JAVA_HOME does not point to the JDK