Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2008

Tip: Looking for answers? Try searching our database.

What's the difference between "JDK" and "JRE"?

Thread view: 
broli - 26 Mar 2008 12:20 GMT
It seems both have a java.exe which can be used to execute the byte
code(.class) but then jre does not have the javac compiler.
Sabine Dinis Blochberger - 26 Mar 2008 12:40 GMT
> It seems both have a java.exe which can be used to execute the byte
> code(.class) but then jre does not have the javac compiler.

You basically answered your own question.
Signature

Sabine Dinis Blochberger

Op3racional
www.op3racional.eu

Andrea Francia - 26 Mar 2008 13:11 GMT
> It seems both have a java.exe which can be used to execute the byte
> code(.class) but then jre does not have the javac compiler.
Google is your friend
http://www.google.com/search?q=jre+jdk+difference

Signature

Andrea Francia
http://www.andreafrancia.it/

Roedy Green - 26 Mar 2008 15:04 GMT
>It seems both have a java.exe which can be used to execute the byte
>code(.class) but then jre does not have the javac compiler.

see http://mindprod.com/jgloss/jre.html
http://mindprod.com/jgloss/jdk.html

You need the JDK if you want to write your own programs.  If you just
want to run them, you can get away with the JRE.
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Mark Space - 26 Mar 2008 17:41 GMT
> It seems both have a java.exe which can be used to execute the byte
> code(.class) but then jre does not have the javac compiler.

Pretty much that is it.  There are more development tools in the JDK
than just javac, but that's the idea.  JRE is just the runtime, for a
user who wants to only run programs other write.  The JDK is for
programmers who need more tools, like javac.
Arne Vajhøj - 28 Mar 2008 20:17 GMT
>> It seems both have a java.exe which can be used to execute the byte
>> code(.class) but then jre does not have the javac compiler.
[quoted text clipped - 3 lines]
> user who wants to only run programs other write.  The JDK is for
> programmers who need more tools, like javac.

It should be noted though that a few server products requires
the JDK just for running, because they use stuff from tools.jar.

Arne
Roedy Green - 28 Mar 2008 23:15 GMT
>It should be noted though that a few server products requires
>the JDK just for running, because they use stuff from tools.jar.

Java.exe  -server lives in the JDK only.
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Arne Vajhøj - 29 Mar 2008 00:01 GMT
>> It should be noted though that a few server products requires
>> the JDK just for running, because they use stuff from tools.jar.
>
> Java.exe  -server lives in the JDK only.

1) No.

C:\Program Files\Java\jre1.6.0\bin>java -?
Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)

where options include:
    -client       to select the "client" VM
    -server       to select the "server" VM

2) Even though most server apps uses the server VM, then it
   is perfectly valid to use server VM for client apps and client
   VM for server apps.

Arne
Roedy Green - 29 Mar 2008 20:24 GMT
>> Java.exe  -server lives in the JDK only.
>
>1) No.

A while a go I did benchmarks with client and server. I found that the
JRE version of java.exe did not understand -server.

the system32 version of java.exe  might be smart enough to use the JDK
version if you use -server.
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Arne Vajhøj - 29 Mar 2008 20:35 GMT
>>> Java.exe  -server lives in the JDK only.
>> 1) No.
[quoted text clipped - 4 lines]
> the system32 version of java.exe  might be smart enough to use the JDK
> version if you use -server.

As I showed then in the stuff you did not quote, then the java.exe
in my JRE does understand (or at least claim to) -server.

It is also very simple to use fc to verify that the java.exe in the
JRE bin and the JDK bin are identical.

Arne
Roedy Green - 29 Mar 2008 22:05 GMT
>It is also very simple to use fc to verify that the java.exe in the
>JRE bin and the JDK bin are identical.

that means little.  They look in the registry ,load dlls, figure out
which JDK/JRE to use etc.  So the exact same executable can behave
differently in different contexts.

The most obvious example would be using an java.exe in a JRE uses that
JRE where the one in system32 looks in the registry ot decide which
JRE to use then loads that one.
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Roedy Green - 29 Mar 2008 22:26 GMT
>As I showed then in the stuff you did not quote, then the java.exe
>in my JRE does understand (or at least claim to) -server.

I just did an experiment

[F:\Program Files\Java\jdk1.6.0_05\jre\bin]java -server -jar
E:\com\mindprod\converter\converter.jar

which would have used the jre java.exe and it worked happily.  You are
correct.  Now the question is, is this behaviour new in 1.6, or was it
always thus and something threw me off earlier.
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Arne Vajhøj - 30 Mar 2008 00:33 GMT
>> As I showed then in the stuff you did not quote, then the java.exe
>> in my JRE does understand (or at least claim to) -server.
[quoted text clipped - 7 lines]
> correct.  Now the question is, is this behaviour new in 1.6, or was it
> always thus and something threw me off earlier.

C:\Program Files\Java\jre1.5.0\bin>java -?
Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)

where options include:
    -client       to select the "client" VM
    -server       to select the "server" VM

C:\Program Files\Java\j2re1.4.2_02\bin>java -?
Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)

where options include:
    -client       to select the "client" VM
    -server       to select the "server" VM

C:\Program Files\Java\j2re1.4.1_02\bin>java -?
Usage: java [-options] class [args...]
           (to execute a class)
   or  java -jar [-options] jarfile [args...]
           (to execute a jar file)

where options include:
    -client       to select the "client" VM
    -server       to select the "server" VM

Arne


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.