File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JRE and JDK" Watch "JRE and JDK" New topic


Shailja Sheetal

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

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

Joined: Oct 02, 2003
Posts: 11955

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="" target="_blank" rel="nofollow">Java Forums</a>
Shailja Sheetal

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
I agree. Here's the link:
subject: JRE and JDK
It's not a secret anymore!