File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes what's JRE for ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what Watch "what New topic
Author

what's JRE for ?

Frank Sikuluzu
Ranch Hand

Joined: Dec 16, 2003
Posts: 116
I know j2sdk1.4.* is used for compiling my code and run my java code. What's JRE for ? when should I need it ? Please be specific
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
The JRE (runtime environment) is everything somebody needs to run Java programs. So if you give your programs to somebody who is not a developer, you can give them the smaller JRE instead of the whole JDK. I've had good luck just copying it onto new machines and setting up some path & classpath stuff in a batch file to run a program. Doing a full-blown install may set some of that up automatically, but risks breaking another program that uses a different version of the JRE.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Frank Sikuluzu
Ranch Hand

Joined: Dec 16, 2003
Posts: 116
Originally posted by Stan James:
The JRE (runtime environment) is everything somebody needs to run Java programs. So if you give your programs to somebody who is not a developer, you can give them the smaller JRE instead of the whole JDK. I've had good luck just copying it onto new machines and setting up some path & classpath stuff in a batch file to run a program. Doing a full-blown install may set some of that up automatically, but risks breaking another program that uses a different version of the JRE.


I am not very clear about this. Do you mean

1. JRE is a subset of JDK ??
2. For JDK, you need to add PATH+\jdk1.4\bin\ in order to compile java code. For JRE, what PATH or CLASSPATh do you need to add in order to run java program ? I assume end users are NOT supposed to add any such thing...
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8874
    
    8

Originally posted by Frank Sikuluzu:

1. JRE is a subset of JDK ??

JDK = Java Development Environment = what we use to develop programs
JRE = Java Runtime Environment = what we use to run programs

Originally posted by Frank Sikuluzu:

2. For JDK, you need to add PATH+\jdk1.4\bin\ in order to compile java code. For JRE, what PATH or CLASSPATh do you need to add in order to run java program ? I assume end users are NOT supposed to add any such thing...

Nope. You can set up an icon, batch file or script to run your program with the correct path and classpath settings, package the app in an
executable jar file or launch it with java webstart.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Shashank Agarwal
Ranch Hand

Joined: May 20, 2004
Posts: 105
Yes, JRE is a subset of JDK. When you install JDK, you automatically install JRE also. However, Sun has made them as two seperate packs so that the user, whose never going to compile in java, dosent have to download the huge JDK. But as a developer, you need to compile as well as run Java Applications.

Understood the diffrence?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what's JRE for ?