One installation JDK
1. Download JDK 7
Choose to download the latest JDK version of JDK 7 from http://www.oracle.com/technetwork/java/javasebusiness/downloads/.
2. Unzip the file
$ sudo MKDIR/USR/LIB/JVM
$ sudo mv jdk-7u4-linux-i586.tar.gz/usr/lib/jvm/
$ cd/usr/lib/jvm/
$ sudo tar-zxvf jdk-7u4-linux-i586.tar.gz
$ rm./jdk-7u4-linux-i586.tar.gz
3. Configuration
$ sudo gedit/etc/environment
Modify path in environment, append JDK path, add classpath and Java_home as follows:
Path= "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/jdk1.7.0_04/bin"
Classpath= "/usr/lib/jvm/jdk1.7.0_04/lib"
Java_home= "/usr/lib/jvm/jdk1.7.0_04"
And then we're going to tell the system that we're using Sun's JDK, not OPENJDK:
$ sudo update-alternatives--install/usr/bin/java Java/usr/lib/jvm/jdk1.7.0_04/bin/java 300
$ sudo update-alternatives--install/usr/bin/javac Javac/usr/lib/jvm/jdk1.7.0_04/bin/javac 300
$ sudo update-alternatives--config java
There are 2 candidates that can be used to replace Java (providing/usr/bin/java).
Select Path Priority state
------------------------------------------------------------
* 0/usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 Auto mode
1/usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 Manual Mode
2/usr/lib/jvm/jdk1.7.0_04/bin/java 300 Manual Mode
To maintain the current value [*] press ENTER, or type the number of your choice: 2
As shown above, this will set up the Java to be used.
Two install eclipse
1. Download Eclipse
Download the appropriate version from http://www.eclipse.org/downloads/index-developer.php, such as: Eclipse IDE for C + + developers
2. Unzip the file
$ sudo mv eclipse-cpp-juno-m7-linux-gtk.tar.gz/usr/lib/
$ cd/usr/lib/
$ sudo tar-zxvf eclipse-cpp-juno-m7-linux-gtk.tar.gz
$ sudo rm./eclipse-cpp-juno-m7-linux-gtk.tar.gz
3. Create a startup shortcut
$ sudo gedit/usr/share/applications/eclipse.desktop
The contents are as follows:
[Desktop Entry]
Type=application
Name=eclipse
Comment=eclipse Integrated Development environment
icon=/usr/lib/eclipse/icon.xpm
Exec=/usr/lib/eclipse/eclipse
Terminal=false
Categories=development;ide; Java;
Ubuntu/lubuntu/xubuntu Linux installation Eclipse