How to change default JRE for all Eclipse workspaces?

后端 未结 11 2114
囚心锁ツ
囚心锁ツ 2020-12-05 09:30

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 i

11条回答
  •  时光说笑
    2020-12-05 10:18

    The Installed JREs is used for what JREs to execute for your downstream Java projects and servers. As far as what JVM or JRE that is used to execute Eclipse process (workbench) itself that is controlled by your environment, history and eclipse.exe binary. So eclipse.exe itself decides what JRE Eclipse will execute itself with, not installed JREs preferences since those are not read until OSGi framework is up and running which is loaded after the JVM/JRE is picked.

    So for new workspaces, Eclipse is going to use its currently executing JRE to populate the JRE prefs.

    The best way I know how is to force eclipse.exe to use the JRE that you tell it via the -vm switch. So in your eclipse.ini do this:

    -startup
    plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
    --launcher.library
    plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
    -vm
    /path/to/exactly/what/jre/you/want/as/default/javaw.exe
    ...
    

提交回复
热议问题