First step: Download jdk-7u79-linux-x64.tar.gz
Wget-c http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-i586.tar.gz
(Note: If the download is not down, it is recommended to use Thunderbolt download, and then copied to the Linux system.) )
Step Two: Unzip the installation
sudo tar zxvf jdk-7u79-linux-x64.tar.gz
Cd/usr/lib/jvm
Step Three: Modify environment variables
Vim ~/.BASHRC
Add to:
Export java_home=/usr/lib/jvm/jdk1.7.0_79
Export JRE_HOME=${JAVA_HOME}/JRE
Export Classpath=.:${java_home}/lib:${jre_home}/lib
Export Path=${java_home}/bin: $PATH
Save the exit and enter the following command to take effect immediately.
SOURCE ~/.BASHRC
Fourth Step: Configure the default JDK version
Since there may be a default JDK in Ubuntu, such as OPENJDK, we will do the following to set up our installed JDK as the default JDK version.
Execute code:
sudo update-alternatives--install/usr/bin/java Java/usr/lib/jvm/jdk1.7.0_79/bin/java 300
sudo update-alternatives--install/usr/bin/javac Javac/usr/lib/jvm/jdk1.7.0_79/bin/javac 300
sudo update-alternatives--install/usr/bin/jar Jar/usr/lib/jvm/jdk1.7.0_79/bin/jar 300
sudo update-alternatives--install/usr/bin/javah javah/usr/lib/jvm/jdk1.7.0_79/bin/javah 300
sudo update-alternatives--install/usr/bin/javap JAVAP/USR/LIB/JVM/JDK1.7.0_79/BIN/JAVAP 300
Execute code:
sudo update-alternatives--config java
The various JDK versions are listed as follows:
[Email protected]:~$ sudo update-alternatives--config java
There are 3 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/java-6-sun/jre/bin/java 63 Manual Mode
3/usr/lib/jvm/java-7-sun/bin/java 300 Manual Mode
To maintain the current value [*] press ENTER, or type the number of your choice: 3
Update-alternatives: Use/usr/lib/jvm/java-7-sun/bin/java to provide/usr/bin/java (Java) in manual mode.
Fifth Step: Test
[Plain] view plaincopy
[email protected]:/usr/lib/jvm/jdk1.7.0_79$ java-version
Java Version "1.7.0_79"
Java (TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot (TM) 64-bit Server VM (build 24.79-b02, Mixed mode)
Sixth Step: Install MyEclipse
This article is from the "Mr_computer" blog, make sure to keep this source http://caochun.blog.51cto.com/4497308/1668808
linux-ubuntu-myeclipse8.5 Installation