Difference between running Eclipse on jvm.dll and java.exe (or javaw.exe)

What is the difference between using jvm.dll and java.exe as JVM for Eclipse to run?


RENOUNCEMENT
I sent this question along with the answer because I find this information useful and want to share it with others.

+2
source share
1 answer

How does Eclipse start when -vm is missing

OK, just to fix the confusion: a new installation of Eclipse on Windows does not have the -vm configuration specified in the eclipse.ini file.

See that the official Equinox Launcher documentation describes a situation where no -vm is not specified (my attention):

When no -vm is specified, the launcher searches for the virtual machine first in the JRE directory in the Eclipse root, and then in the search path. If Java is located anywhere, then we are looking for the JVM shared library (jvm.dll on Window platforms, libjvm.so on * nix) regarding this Java executable.

  • If the JVM is found to be a shared library , we load it and use the JNI call API to start vm
  • If the shared JVM library is not found , we run a Java launch to start vm in the new process.

So, as you can see, jvm.dll is the one that is executed first, and ONLY if it is not found, then a Java launcher is used (for example, java.exe or javaw.exe).


The difference between using jvm.dll and javaw.exe (or java.exe)

  • When using jvm.dll, Eclipse uses the JNI call API to start vm in the current process . In the task manager, you will see only ONE process:
    eclipse.exe

  • When using javaw.exe (or java.exe), Eclipse runs the Java Launcher to start vm in a new process . In the task manager, you will see two processes:
    1) eclipse.exe
    2) javaw.exe (or java.exe if it was configured)

    javaw.exe is a subprocess (child process) of the eclipse.exe process.

So, the choice is up to you. Read the following article that perfectly explains and illustrates the possible consequences of using jvm.dll or javaw.exe: Eclipse.exe and Windows processes


Other thoughts

One of the most recommended use cases is to specify a specific JVM to run Eclipse. This ensures that you are absolutely sure that the Eclipse JVM will work and isolates you from system changes that can change the default JVM for your system. Read more here: JVM Note

+3
source

All Articles