Install Eclipse with Sun JDK Ubuntu

Eclipse is an open source community whose projects are focused on building an open development platform comprised of extensible frameworks, tools and runtimes for building, deploying and managing software across the life cycle . A large and vibrant ecosystem of major technology vendors, innovative start-ups, universities, research institutions and individuals extend, complement and support the Eclipse platform.

Install Eclipse with Sun JDK 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

and add


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.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s