File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes IDEs, Version Control and other tools and the fly likes Changing to another JRE in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Changing to another JRE in Eclipse" Watch "Changing to another JRE in Eclipse" New topic

Changing to another JRE in Eclipse

Peter Sorotokin
Ranch Hand

Joined: Jun 25, 2013
Posts: 36

I have a dual boot PC . Both of them Windows . I installed first Windows in drive C: and immediately installed Eclipse and used that , then installed second Windows on drive D: and didn't installed a new Eclipse and used the first Eclipse in second Windows . But when i run Java applications , Eclipse didn't work correctly and it shows that it uses JRE that was installed in C: in the first Windows and i think that it is the source of my problems . How i can change JRE in my Eclipse to the new ones that installed in the second Windows ? Thanks
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

Hello Peter and welcome to the Ranch

JREs can be configured inside eclipse optionally. The settings can be found here windows -> Preferences -> installed JREs. Give the path to the other JRE that you wish to use and it will work fine .

Do post back for any further queries.

Muhammad Saif Asif Mirza
Peter Johnson

Joined: May 14, 2008
Posts: 5852

Another possibility is to edit the eclipse.ini file and add the following lines just before the "-vmargs" line:


The <path-to-jvm> cane being a full path to either the java or javaw executables or to the jvm DLL (Windows) or SO (Linux)
For example, on my Windows system I have (I use server because it is a 64-bit JVM):


This then becomes the JVM that runs Eclipse itself, and is the also the default JRE. The mechanism Saif describes enables you to identify additional JDKs to use for compiling or running apps.

JBoss In Action
I agree. Here's the link:
subject: Changing to another JRE in Eclipse
It's not a secret anymore!