Which java(w) command should I use to get the best performance?

Hi all, on win32, there are four executable name "java(w)" after installing JDK 1.5:

1. C:\Program Files\Java\jdk1.5.0_01\bin\java(w)

2. C:\Program Files\Java\jdk1.5.0_01\jre\bin\java(w)

3. C:\Program Files\Java\jre1.5.0_01\bin\java(w)

4. C:\WINDOWS\system32\java(w)

Which java(w) command should I use to get the best performance when running an app? I think 3 or4 should be used but I'm not sure. Anyonce can tell me the detailed difference of them?

Furthermore, I always think the libs shiped with the private JRE of JDK has debug information compiled in, so there should be some performance lost if either 1 or 2 is used. While the public JRE's libs are clean and should make the best performance. Is this right?

[760 byte] By [xuhaoqinga] at [2007-10-1 1:36:50]
# 1

> 4. C:\WINDOWS\system32\java(w)

Non-standard this could be any version.

> Which java(w) command should I use to get the best performance when running an app?

java displays a console, whereas javaw does not. Turning off the console could improve perforamance, but it might be needed to run the application.

> I think 3 or4 should

> be used but I'm not sure. Anyonce can tell me the

> detailed difference of them?

None.

> Furthermore, I always think the libs shiped with the

> private JRE of JDK has debug information compiled in,

> so there should be some performance lost if either 1

> or 2 is used.

The debug inofrmation is additional information which affects the size of the generated code but has no effect on performance. If you can find any counter example I would be interested. :)

> While the public JRE's libs are clean

> and should make the best performance. Is this right?

Both contain debug information, the JRE does not have code which allows you to compile a program. The JRE take up less space than the JDK.

Peter-Lawreya at 2007-7-8 1:56:44 > top of Java-index,Administration Tools,Sun Connection...
# 2
Thank you for the explanation.Now I believe running an app using either JDK or JRE version java(w) makes no performance difference.So, why does Sun needs a separate JRE for JDK's private use? Doesn't it make sence that let JDK just use public JRE?
xuhaoqinga at 2007-7-8 1:56:44 > top of Java-index,Administration Tools,Sun Connection...
# 3

This is just a guess, but it may be to ensure that there is a JRE readily available. The pulibc JRE can easily be installed in a location the JDK doesn't expect. The public JRE can be uninstalled without uninstalling the JDK. An older or newer version of the public JRE can be installed without the JDK's awareness. In short, the JDK just plain can't depend on the public JRE to be there or be what it needs in order to function properly.

Legend_Keepera at 2007-7-8 1:56:44 > top of Java-index,Administration Tools,Sun Connection...
# 4
Thank you. Sound to me.
xuhaoqinga at 2007-7-8 1:56:44 > top of Java-index,Administration Tools,Sun Connection...