Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Point eclipse IDE to use another JRE / JDK other than one specified in JAVA_HOME

Tags:

java

eclipse

I am having two JRE / SDK in my development environment, however it was necessary in my situation to set JAVA_HOME to 1.4.2, this is causing my eclipse IDE to stop running as it required 1.6 and above.

May i know how i can modify eclipse ini or environment home to use my other 1.6 installation?

like image 890
Oh Chin Boon Avatar asked Jul 30 '11 06:07

Oh Chin Boon


People also ask

How do I change the default JRE library in Eclipse?

Configure the default JRE Set it as the default in Eclipse by selecting Preferences -> Java -> Installed JREs. Add the installed JDK and select the checkbox, making it the default.

Can I have different JDK and JRE?

Coming to your Question; No it is not necessary to have both JDK and JRE of same version as we don't use both at the same time.


2 Answers

Please try the eclipse.ini entry above the varargs (the following two lines must be two lines in the eclipse.ini file)

-vm
C:\Java\JDK\1.5\bin\javaw.exe

Find the JVM

like image 99
Markus Lausberg Avatar answered Sep 19 '22 15:09

Markus Lausberg


Right click the project in Package Explorer -> Configure Build Path

Right click the project in Package Explorer -> Configure Build Path

Add Library -> JRE System Library

Add Library -> JRE System Library

Set JRE system library to JDK

Set JRE system library to JDK

Verify JDK is the reference library

Verify JDK is the reference library

like image 40
emallove Avatar answered Sep 19 '22 15:09

emallove