Ubuntu12.10 install and configure the JDK7 Environment

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.