Eclipse如何找到JRE或JDK位置? [英] How Does Eclipse find the JRE or JDK locaton?

查看:1284
本文介绍了Eclipse如何找到JRE或JDK位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据Eclipse FAQ。我读到



Eclipse不要查阅JAVA_HOME环境变量。



我的疑问是eclipse如何初始化虚拟机。它不知道 Java 的位置。我的 eclipse.ini 文件没有 -vm 配置。仍然能够运行eclipse。



来源



更新



根据Eclipse 安装指南 Eclipse不会将条目写入Windows注册表

解决方案

据我所知,为了调用JVM,Eclipse执行 java 命令,如果是在系统执行路径下,Eclipse将不需要找到安装目录。



要检查,可以启动一个OS shell并执行下一个命令从任何位置):

 > java -version 

编辑:我(部分)错了。从常见问题解答( http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F#Find_the_JVM


如果在eclipse / jre目录中安装了JVM,Eclipse将使用
它;否则启动器将参考eclipse.ini文件和
系统路径变量


所以,Eclipse首先看看它的日食/ jre dir for installed VMs,如果为空,请查阅eclipse.ini文件,最后查看系统路径。


According to the Eclipse FAQ. I read that

Eclipse DOES NOT consult the JAVA_HOME environment variable.

My doubt is how does eclipse initializes the Virtual Machine. It does not know the location of Java. My eclipse.ini file does not have -vm configuration. Still I am able to run eclipse.

The Source

UPDATE

According to Eclipse Installation Guide. Eclipse does not write entries to the Windows registry.

解决方案

As far as I know, to invoke the JVM, Eclipse executes the java command, so, if it's at your system execution path, Eclipse won't need to find the instalation directory.

To check, you can start a OS shell and execute the next command (from any location):

> java -version

EDIT: I was (partially) wrong. From the FAQ (http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F#Find_the_JVM)

If a JVM is installed in the eclipse/jre directory, Eclipse will use it; otherwise the launcher will consult the eclipse.ini file and the system path variable

So, Eclipse first looks inside its eclipse/jre dir for installed VMs, if empty, consults the eclipse.ini file, and at last, looks at the system path.

这篇关于Eclipse如何找到JRE或JDK位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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