Ubuntu12.04 install JDK 7

Source: Internet
Author: User
Ubuntu12.04 install JDK 7 process Notes: The supervisor copies the file to the/usr/lib/jvm/directory. If no jvm folder exists, create the folder. command: sudomkdirjvm // create the folder jvmsudocp-r ~ /Dow

Notes for installing JDK 7 in Ubuntu 12.04:

1. Download jdk-7u4-linux-i586.tar.gz to oracle_download first

2. Copy jdk-7u4-linux-i586.tar.gz to the/usr/lib/jvm/directory. If no jvm folder exists, create the folder. Run the following command:

Sudo mkdir jvm// Create a folder jvm

Sudo cp-r ~ /Download/Jdk-7u4-linux-i586.tar.gz/Usr/lib/jvm// Copy the downloaded file to the directory created in the heart

Sudo tar-zxvgJdk-7u4-linux-i586.tar.gz// Decompress the file

3,Set environment variables and use gedit to open the/etc/profile file

Sudo gedit/etc/profile

Add the following at the end of the file:

ExportJAVA_HOME=/Usr/lib/jdk1.7.0 _ 04

ExportPATH=$ JAVA_HOME/Bin:$ JAVA_HOME/Jre/bin:$ PATH

ExportCLASSPATH=$ CLASSPATH:.:$ JAVA_HOME/Lib:$ JAVA_HOME/Jre/lib

4. Modify the default jdk of the system.

$ Sudo update-alternatives -- install/usr/bin/java/usr/lib/jvm/java1.7.0 _ 04/bin/java 300

$ Sudo update-alternatives -- install/usr/bin/javac/usr/lib/jvm/java1.7.0 _ 04/Bin/javac 300

$ Sudo update-alternatives -- config java
$ Sudo update-alternatives -- config javac

5. Check and enter java-version

Java version "1.7.0 _ 04"
Java (TM) SE Runtime Environment (build 1.7.0 _ 04-b20)
Java HotSpot (TM) Server VM (build 23.0-b21, mixed mode)

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

Related Article

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.