在jvm.dll和java.exe(或javaw.exe)上运行Eclipse之间的区别 [英] Difference between running Eclipse on jvm.dll and java.exe (or javaw.exe)

查看:160
本文介绍了在jvm.dll和java.exe(或javaw.exe)上运行Eclipse之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 jvm.dll java.exe 作为运行Eclipse的JVM有什么区别?

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

免责声明
我将这个问题和答案一起发布了,因为我发现此信息很有用,并希望与他人分享.

推荐答案

在未指定-vm的情况下如何启动Eclipse

好的,只是为了解决一个混乱:在Windows上全新安装的Eclipse在 eclipse.ini 文件中没有指定 -vm 配置.

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.

让我们看看正式的 Equinox Launcher 文档说说未指定-vm时的情况(强调我的情况):

Let's see what the official Equinox Launcher documentation says about situation when no -vm is specified (emphasis mine):

未指定-vm时,启动程序将首先在eclipse根目录的JRE目录中查找虚拟机,然后在搜索路径中查找.如果 在任一位置都可以找到Java,然后我们在JVM上找到一个JVM 共享库 ( jvm.dll libjvm.so (在* nix平台上)相对于该Java可执行文件.

When no -vm is specified, the launcher looks for a virtual machine first in a JRE directory in the root of eclipse and then on the search path. If Java is found in either location, then we look for a JVM shared library (jvm.dll on Window, libjvm.so on *nix platforms) relative to that Java executable.

  • 如果找到JVM 共享库 ,我们将其加载并使用JNI调用API来启动vm
  • 如果未找到JVM共享库,我们将执行Java启动器以在新进程中启动vm
  • If a JVM shared library is found we load it and use the JNI invocation API to start the vm
  • If no JVM shared library is found, we exec the Java launcher to start the vm in a new process

如您所见, jvm.dll 是首先搜索的文件,只有在未找到的情况下,然后才是Java启动器(即java.exe或javaw.exe).

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.

  • 使用 jvm.dll 时,Eclipse使用JNI Invocation API来 在当前进程中启动虚拟机.您将在任务管理器中仅看到一个进程:
    eclipse.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

使用 javaw.exe (或 java.exe )时,Eclipse执行该Java 启动器,以在新过程中启动虚拟机.您将在任务管理器中看到两个进程:
1) eclipse.exe
2) javaw.exe (如果已配置,则为 java.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:
1) eclipse.exe
2) javaw.exe (or java.exe if it was configured)

javaw.exe 将是 eclipse.exe 进程的子进程(子进程).

The javaw.exe will be the sub-process (child process) of the eclipse.exe process.

因此,选择权取决于您.阅读以下文章,该文章很好地解释和说明了使用 jvm.dll javaw.exe 可能产生的后果:

So the choice is up to you. Read the following article which nicely explains and illustrates possible consequences of using either jvm.dll or javaw.exe: Eclipse.exe and windows processes

最推荐使用的选项之一是指定一个特定的JVM 供Eclipse运行.这样做可以确保您完全确定将在哪个JVM Eclipse中运行,并使您免受可能更改系统的默认" JVM的系统更改的影响.在此处了解更多信息:指定JVM

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

这篇关于在jvm.dll和java.exe(或javaw.exe)上运行Eclipse之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆