When to use JDK to launch application (javaw.exe) and when to use JRE?

1k Views Asked by At

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?

2

There are 2 best solutions below

1
On

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.

0
On

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