How to Install and setup Eclipse with Sun’s Java
Installing Eclipse,Sun Java in Ubuntu
sudo apt-get install eclipse sun-java6-jdk
This will install the required packages, however, Eclipse will run very slowly since it will be using GNU's java, not Sun's. We now need to make Sun's java the default.
sudo update-java-alternatives -s java-6-sun
Next, edit the JVM configuration file
sudo -b gedit /etc/jvm
and add the following to the top of the file
There is a bug right now were Eclipse ignores Ubuntu's java-common settings and uses its own (bug 45347). To work around the bug, you need to edit Eclipse's java_home file
sudo -b gedit /etc/eclipse/java_home
to the top of the file.
Lastly, if you have lots of memory you may want to increase the heap size (warning: If you make the heap size too large then parts of eclipse will continuously swap in and out.).The settings can be altered by editing the eclipse.ini file.
For feisty users:
sudo -b gedit /usr/lib/eclipse/eclipse.ini
The argument Xms refers to the minimum heap size and Xmx refers to the maximum heap size.