Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what's JRE for ?

 
Frank Sikuluzu
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Frank Sikuluzu
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 9258
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Shashank Agarwal
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic