To force eclipse to use desired java version, then we need to provide the below in the eclipse.ini file.
To run build.xml to use desired java version, then In Eclipse:
– Right click on your build.xml
– click “Run As”, click on “External Tool Configurations”
– Select tab JRE. Select the JRE you are using