Tuesday, November 17, 2015

To run eclipse with specific Java Version

In some cases, we need to run the eclipse instance with an another java version instead of default java version. i.e the default JAVA is jre7, but we need to run the eclipse with jre8 for the purpose of JAVA Fx application development purpose. We can overcome this situation with three different ways.

1. Changing the default Java version to our needed Java version.
2. Running the Java with the specific java version through command line
3. We can set the specific Java for specific eclipse modifying the eclipse.ini file in the eclipse folder


According to me, the last one is the best policy as for performing first  of them may affect other programs and for performing second of them is disturbing .

For running commnad line:
need to go to the location of bin folder of eclipse and executing the below command:
./eclipse -vm /usr/lib/jvm/jdk1.8.0_65/bin/



To change in the eclipse.ini file, we need to locate the file at first. Its location is in the bin folder also.
We need to add a line above the

-vmargs

at first I add directly as:

-vm  /usr/lib/jvm/jdk1.8.0_65/bin/

 above the -vmargs line. But this was not working for me. After that i used:
-vm  
/usr/lib/jvm/jdk1.8.0_65/bin/

and its working fine.

No comments: