Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changing to another JRE in Eclipse

 
Peter Sorotokin
Ranch Hand
Posts: 36
1
Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
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
Posts: 440
Eclipse IDE Hibernate Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another possibility is to edit the eclipse.ini file and add the following lines just before the "-vmargs" line:

-vm
<path-to-jvm>

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):

-vm
c:/apps/Java/jdk-1.7.0_25/jre/bin/server/jvml.ddl

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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic