Install and configure the JDK 7 environment under Ubuntu12.10. Put the supervisor in the installation directory, for example, I directly put it in the/usr directory 3. Switch to the/usr directory cd
Install and configure the JDK 7 environment in Ubuntu 12.10.
1. Download jdk7.0
Download the latest jdk7.0 from the official website.
My computer is a 32-bit computer, so I choose the latest version jdk-7u11-linux-i586.tar.gz.
2. Put the downloaded jdk-7u11-linux-i586.tar.gz in the installation directory, for example, directly under the/usr directory.
3. Switch to the/usr directory
Cd/usr
4. Decompress jdk
Sudo tar-zxvf jdk-7u11-linux-i586.tar.gz
5. Configure the environment variables.
Sudo gedit/etc/profile
6. Add it after the/etc/prifile file (Note: here the JDK path is changed to your own installation path)
Export JAVA_HOME =/usr/jdk1.7.0 _ 11
Export JRE_HOME =/usr/jdk1.7.0 _ 11/jre
Export PATH = $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin: $ PATH
Export CLASSPATH = $ CLASSPATH:.: $ JAVA_HOME/lib: $ JAVA_HOME/jre/lib
7. Make the modified/etc/profile take effect immediately
./Etc/profile
8. modify the system's default JDK and make it take effect immediately (Note: change it to your own path. If you want to install myeclipse, this step is required; otherwise, errors will occur)
Sudo update-alternatives -- install "/usr/bin/java" "java" "/usr/bin/jdk1.7.0 _ 11/java" 300
Sudo update-alternatives -- install "/usr/bin/javac" "javac" "/usr/jdk1.7.0 _ 11/bin/javac" 300
Sudo update-alternatives -- install "/usr/bin/javaws" "javaws" "/usr/jdk1.7.0 _ 11/bin/javaws" 300
Sudo update-alternatives -- config java
Sudo update-alternatives -- config javac
Sudo update-alternatives -- config javaws
9. OK. After the operation is completed, use java-version to view the effect.
Java version "1.7.0 _ 11"
Java (TM) SE Runtime Environment (build 1.7.0 _ 11-b21)
Java HotSpot (TM) Server VM (build 23.6-b04, mixed mode)
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2