I am running Linux and have Java 6 installed. My JAVA_HOME is set to:
/usr/local/java/jdk1.6.0_02
I have noticed that under $JAVA_HOME/bin I have the following members
java javac javadoc javah javap java-rmi.cgi javaws
yet, under $JAVA_HOME/jre/bin I have the following members
../jre/bin/java ../jre/bin/java_vm ../jre/bin/javaws
My question is, what is the difference between the java (and javaws) in
${JAVA_HOME}/bin and ${JAVA_HOME}/jre/bin?
There may be a similar setup in Windows, but I don't use that operating
system for my own development.
Perhaps someone can shed some light on this for me.
Thanks
N

Signature
There are 10 types of people in the world:
Those that know binary
Those that do not know binary
Andrew Thompson - 13 Jul 2007 05:10 GMT
...
>My question is, what is the difference between the java (and javaws) in
>${JAVA_HOME}/bin and ${JAVA_HOME}/jre/bin?
There should be no difference between Java and Java Web
Start executables between the JRE and JDK for identical
Java version releases (and probably little difference between
most versions, either).
The JDK duplicates them so it can run either Java or
JWS even on a box with no JRE, I expect.
...
>There may be a similar setup in Windows,
Yes. Win is the same. One of my 1.5 JRE's
has 16 .exe's, the euivalent JDK has 28 - both
include java.exe, javaw.exe (java with no window)
& javaws.exe.
HTH

Signature
Andrew Thompson
http://www.athompson.info/andrew/
Andrew Thompson - 13 Jul 2007 05:17 GMT
...
>>My question is, what is the difference between the java (and javaws) in
>>${JAVA_HOME}/bin and ${JAVA_HOME}/jre/bin?
Sh*t! Sorry. My entire answer was to a question you did
not ask. I was comparing the JRE structure to a JDK,
whereas you are referring to the jre/ directory *inside* the
JDK, right?
A quick check supports the Win. JDK also has a jre/
directory - also with the java.exe (etc.) duplicated, but
no, I do not immediately know why.

Signature
Andrew Thompson
http://www.athompson.info/andrew/
Mr. N. Marshall - 13 Jul 2007 05:51 GMT
> ..
>>> My question is, what is the difference between the java (and javaws) in
[quoted text clipped - 4 lines]
> whereas you are referring to the jre/ directory *inside* the
> JDK, right?
Yes. I was curious to see if there was any difference or if the two
programs were interchangeable. It appears that they are. I know that
certain programs depend on a jre being present and will not work if a
jdk is specified regardless of whether or not there is a jre inside the jdk.

Signature
N. Marshall
There are 10 types of people in the world:
Those that know binary
Those that do not know binary
Paul Tomblin - 13 Jul 2007 14:42 GMT
In a previous article, "Mr. N. Marshall" <mr_n_mashall@hotmail.NOSPAM.com> said:
>My question is, what is the difference between the java (and javaws) in
>${JAVA_HOME}/bin and ${JAVA_HOME}/jre/bin?
Nothing.
[tomblin@chicago jdk1.5.0_11]$ diff bin/java jre/bin/java
[tomblin@chicago jdk1.5.0_11]$ diff bin/javaws jre/bin/javaws
[tomblin@chicago jdk1.5.0_11]$

Signature
Paul Tomblin <ptomblin@xcski.com> http://blog.xcski.com/
Violence is the last resort of the incompetent.
The competent, of course, make it their *first* resort.
Roedy Green - 13 Jul 2007 19:42 GMT
On Thu, 12 Jul 2007 22:20:24 -0300, "Mr. N. Marshall"
<mr_n_mashall@hotmail.NOSPAM.com> wrote, quoted or indirectly quoted
someone who said :
>My question is, what is the difference between the java (and javaws) in
>${JAVA_HOME}/bin and ${JAVA_HOME}/jre/bin?
Why does Sun give you three copies of the executables such as
java.exe?
The C:\Program Files\java\jre1.6.0_01\bin version is for ordinary
production client use.
The J:\Program Files\java\jdk1.6.0_01\jre\bin version is for
production servers. The java.exe there understands the -server option.
The J:\Program Files\java\jdk1.6.0_01\bin version is for debugging.
In practice, most of the files are identical. You normally just put
the J:\Program Files\java\jdk1.6.0_01\bin version on your path when
developing and you get everything you need, including javac.exe, with
maximal help in tracking problems.
For client use, you don't need to put anything on the path. The JRE
installer puts a dummy copy of java.exe on the path in
C:\WINNT\system32 to get things started. When it is invoked, it looks
in the registry to find the current actual java.exe. javaws.exe works
the same way.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Mr. N. Marshall - 13 Jul 2007 23:46 GMT
> Why does Sun give you three copies of the executables such as
> java.exe?
I have no idea. All I did was download the package from Sun and ran the
install. I guess that when you download the JRE you only get the stuff
for the JRE, but if you get the JDK, you get both.
http://java.sun.com/javase/downloads/index.jsp
The Java SE Runtime Environment (JRE) allows end-users to run Java
applications.
The Java SE Development Kit (JDK) includes the Java Runtime Environment
(JRE) and command-line development tools that are useful for developing
applets and applications.
But that doesn't really answer my question. I guess that when you are
just running apps, you use the JRE, but when you are developing apps,
you would use the JDK.

Signature
N. Marshall
There are 10 types of people in the world:
Those that know binary
Those that do not know binary