I am try to set java virtual machine path in eclipse and tomcat, and find out there is "javaw.exe" in both the JDK and JRE directories.
Which "javaw.exe" should be used, and why?
These javaw
executables are identical. You can see it yourself - compare their sizes.
As this link says
JDK includes the JRE plus command-line development tools
So whenever you are doing some development-related stuff you should use the one from JDK.
PS:
as Amir mentioned earlier - you probably don't want to use javaw
at all...
You shouldn't be using javaw as it is java without a console. Using the
java
in JDK is probably the safest. JRE is only the runtime and it will also work. But when developing I recommend JDK because that's also where javac.