Question about JDK and JRE directories under Linux

M

Mr. N. Marshall

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
 
A

Andrew Thompson

Mr. N. Marshall wrote:
...
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

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-general/200707/1
 
A

Andrew Thompson

...
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.

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-general/200707/1
 
M

Mr. N. Marshall

Andrew said:
..

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?
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.

--
N. Marshall

There are 10 types of people in the world:
Those that know binary
Those that do not know binary
 
P

Paul Tomblin

In a previous article 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]$
 
R

Roedy Green

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.
 
M

Mr. N. Marshall

Roedy said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top