如何更改所有Eclipse工作区的默认JRE? [英] How to change default JRE for all Eclipse workspaces?

查看:717
本文介绍了如何更改所有Eclipse工作区的默认JRE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 C:\Program Files(x86)\Java\jre6 中有一个JRE,这是我安装Eclipse时唯一的JRE。我随后在 C:\home\SFTWR\jdk1.6.0_21 中安装了一个完整的JDK,并更改了我的 JAVA_HOME 环境变量。但是,每次启动新的Eclipse工作区时,它只会选择旧的JRE,我必须手动删除它并添加新的JRE。

I have one JRE in C:\Program Files (x86)\Java\jre6 and that was the only one at the time I installed Eclipse. I have subsequently installed a complete JDK in C:\home\SFTWR\jdk1.6.0_21 and changed my JAVA_HOME environment variable to that. However, every time I start a new Eclipse workspace, it only picks up the old JRE and I have to manually remove it and add the new one.

如何将Eclipse安装绑定到新的JDK,以便每个新工作区只指向?我检查了 eclipse.ini ,但没有参考到哪个JRE去。

How do I bind my Eclipse install to the new JDK so that every new workspace points to that only? I checked eclipse.ini but there was no reference there to which JRE to go to.

更新:

我进了 Prefs-> Java->安装的JRE 新位置,将其标记为默认值,删除另一个,它仅对当前工作空间有效。但是,当我打开一个新的工作区时,只有旧的JRE可用。所以这并没有改变适用于所有(至少新的)工作空间的核心Eclipse配置

I went into Prefs->Java->Installed JREs, added the new location, marked it as default, removed the other, and it was effective only for the current workspace. However, when I opened a new workspace, only the old JRE was available. So this didn't change the core Eclipse config that is applicable across all (at least new) workspaces

推荐答案

最后得到它: Eclipse接收JRE的方式是使用系统的PATH

我没有 C:\home\SFTWR\jdk1.6.0_21\bin 以前的路径,我确实有 C:\Program Files(x86)\Java\jre6\bin 。我已经将 JRE_HOME JAVA_HOME 设置为 C:\home\SFTWR\ jdk1.6.0_21 ,但这两个都不重要。我猜Eclipse(在UNIX / Linux上)(或哪个)可以看到Java在路径中的位置,并将JRE java.exe 属于。在我的情况下,尽管我完成了所有的配置调整(包括上面提到的 eclipse.ini -vm选项),但它仍然停留在路径中。

I did not have C:\home\SFTWR\jdk1.6.0_21\bin in the path at all before and I did have C:\Program Files (x86)\Java\jre6\bin. I had both JRE_HOME and JAVA_HOME set to C:\home\SFTWR\jdk1.6.0_21 but neither of those two mattered. I guess Eclipse did (something to the effect of) where java (or which on UNIX/Linux) to see where Java is in the path and took the JRE to which that java.exe belonged. In my case, despite all the configuration tweaks I had done (including eclipse.ini -vm option as suggested above), it remained stuck to what was in the path.

我从路径中删除了旧的JRE bin,将新的JRE bin放入,它适用于所有工作区。

I removed the old JRE bin from the path, put the new one in, and it works for all workspaces.

这篇关于如何更改所有Eclipse工作区的默认JRE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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