When eclipse is installed it uses OpenJdk by default. Eclipse gives a good performance when it is run on sun java. To change the JDK used by eclipse we got to do a couple of changes.
Open a terminal and type the following command
sudo gedit /etc/eclipse/java_home
In the file add the following line on the top of the list which represents the JDK search order of eclipse
/usr/lib/jvm/java-6-sun
Save and Close the file.
Restart eclipse. Now eclipse will run on sun java giving a good performance.