During Ubuntu installation, Java of the GNU version will be installed at the same time, just like in most Linux releases. This Java is too practical, especially for developers, it is not very useful. Installing Sun Java in Ubuntu is very easy. Step 1:
Sudo apt-Get install sun-java6-jre
Sudo apt-Get install sun-java6-jdk
After the installation is complete, select the default Java:
Sudo Update-alternatives -- config Java
Then configure the environment variable:
Sudo Vim/etc/environment
Add the following two lines:
Classpath =/usr/lib/JVM/Java-6-sun/lib
Java_home =/usr/lib/JVM/Java-6-sun
Save and exit. Install and configure eclipse. Installation is simple:
Sudo apt-Get install eclipse
Although the newly installed Java has become the default JVM of the system, eclipse does not use the update-alternative setting.
JVM to start itself, and the previous GNU Java is used. GNU Java is an implementation of 1.4.2, and its performance is far inferior to that of sun. To make
Eclipse is started using sun java. We need to continue to configure it. First, set Sun Java to the default JDK:
Sudo Update-Java-alternatives-s Java-6-sun
Then edit the JVM configuration file:
Sudo Vim/etc/JVM
Put
/Usr/lib/JVM/Java-6-sun
This line moves to the top of the configuration block. Because eclipse ignores Ubuntu's general Java settings (which looks like a bug), we need to edit
Java_home file:
Sudo Vim/etc/Eclipse/java_home
As above
/Usr/lib/JVM/Java-6-sun
This line moves to the top of the file. After all the installation and configuration are completed, the Java Development Platform of Ubuntu is basically complete.
Install CDT:
Slave
Http://www.eclipse.org/cdt/downloads.php
Download CDT
Tar zxvf org.eclipse.cdt-3.1.2-linux.x86.tar.gz
Decompress the package and copy all the files in the features and plugins folders to the corresponding directory in/usr/lib/eclipse.
Original article: http://blog.csdn.net/firefoxboy/archive/2008/11/26/3380225.aspx