What is the difference between using jvm.dll and java.exe as the JVM for Eclipse to run on?
DISCLAIMER
I have posted this question along with the answer because I find this information useful and want to share this with others.
eclipsejvmwindows
What is the difference between using jvm.dll and java.exe as the JVM for Eclipse to run on?
DISCLAIMER
I have posted this question along with the answer because I find this information useful and want to share this with others.
Best Answer
How Eclipse is launched when no -vm is specified
OK, just to resolve a confusion: fresh installation of Eclipse on Windows has no -vm configuration specified in the eclipse.ini file.
Let's see what the official Equinox Launcher documentation says about situation when no
-vm
is specified (emphasis mine):So as you can see, the jvm.dll is the one that is searched for in the first place, and ONLY if it is not found, THEN the Java launcher (i.e. java.exe or javaw.exe) is used.
Difference between using jvm.dll and javaw.exe (or java.exe)
When using jvm.dll Eclipse uses the JNI Invocation API to start the vm in the current process. You will see only ONE process in the task manager:
eclipse.exe
When using javaw.exe (or java.exe) Eclipse executes that Java Launcher to start the vm in a new process. You will see TWO processes in the task manager:
The javaw.exe will be the sub-process (child process) of the eclipse.exe process.
So the choice is up to you.
Other thoughts
One of the most recommended options to use is to specify a specific JVM for Eclipse to run on. Doing this ensures that you are absolutely certain which JVM Eclipse will run in and insulates you from system changes that can alter the "default" JVM for your system. Read more here: Specifying the JVM