3

As you know, during using eclipse, we can try to chang the VM arguments in eclipse.ini, like

-Xmx1024m

it's easy to understand this if we just execute Java from command line with such arguments. However during we started eclipse, we invoke “eclipse.exe",right ? Also eclipse can allow us to change the JDK during runtime.

so in my opinion, the eclipse will start as the parent process, then it will start JVM subchild process to handle Java stuff. But I am not sure about this, as I can't decompile the eclipse.exe. If you are familiar with the start process, then please help to clear about this. Appreciated for your comments.

Ivan
  • 766
  • 6
  • 17
  • You incorrectly assume that Eclipse can change the JDK runtime. You change only the JDK, which is used for compilation and debugging, but doesn't change the JDK which runs the Eclipse itself. The only exception to this is when you restart Eclipse. In this case, it will restart the whole JVM. – Danail Nachev May 30 '11 at 22:26
  • oh.. I got it. We can just change the library. – Ivan May 31 '11 at 02:23

2 Answers2

3

The term Eclipse uses for this executable is "Launcher". You may find some useful information in the answer to this question:

Why does Eclipse use a native launcher?

Community
  • 1
  • 1
  • yes, you are right.The question partically answer my doubt. From the eclipse wiki page, I know eclipse.exe will launch vm using JNI. As statement in the wiki, **will load the jvm shared library and use JNI to create the vm** , does system process can create another system process in the same process? My answer is not.I can only see one process in task manager. I am a little confused. – Ivan May 31 '11 at 02:15
  • So maybe "create vm" doesn't mean to create a Java process. – Ivan May 31 '11 at 02:17
  • 1
    See Ernest's remarks about JVM.DLL and http://stackoverflow.com/questions/6134350/difference-between-java-and-libjvm-so-linux-or-jvm-dll-windows – HostileFork says dont trust SE May 31 '11 at 12:16
  • yes, the link you give is very helpful. Sorry about my careless search before ask one question. – Ivan Jun 02 '11 at 02:40
0

Yes, eclipse.exe is a small wrapper program that starts its own JVM, which is then used to run the rest of Eclipse. It does little more than find a JVM, set up a few paths and class loaders, and pass its arguments along.

Ernest Friedman-Hill
  • 80,601
  • 10
  • 150
  • 186
  • So eclipse.exe is just like another format bat script which can use JNI to start JVM, right? Then about "start its own JVM", does this mean a new Java process is created? Thanks – Ivan May 31 '11 at 02:20
  • 2
    The Windows program `java.exe` is a very small program that links in the Java Virtual Machine from a library named (usually) `jvm.dll`. That small program processes the command line arguments, loads in a class, and calls `main()` (all from JNI). The program `eclipse.exe` is a very similar small program that links the JVM library, processes arguments, loads a class, and invokes it (again, all from JNI). The JVM is started in the *same process*, not a new one. – Ernest Friedman-Hill May 31 '11 at 02:28