Ubuntu12.04x64install jdk-7u45-linux-x64.tar.gz

Source: Internet
Author: User
Ubuntu12.04x64install jdk-7u45-linux-x64.tar.gz process record: 1. download the latest version jdk64-bit((jdk-7u45-linux-x64.tar.gz) from the official website-

Ubuntu 12.04x64 install jdk-7u45-linux-x64.tar.gz process record:

1. First download the latest jdk 64-bit (jdk-7u45-linux-x64.tar.gz)

Download http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html from official website

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

Sudo mkdir jvm // create a folder jdk

Sudo cp-r ~ /Download/jdk-7u45-linux-x64.tar.gz/usr/lib/jvm // copy the downloaded file to the newly created directory

Sudo tar-zxvg jdk-7u45-linux-x64.tar.gz // Extract files

3.Set environment variables and use nano to open the/etc/profile file.

Sudo nano/etc/profile

Add the following at the end of the file:

Export JAVA_HOME =/usr/lib/jvm/jdk1.7.0 _ 45

Export JRE_HOME =/usr/lib/jvm/jdk1.7.0 _ 45/jre

Export PATH = $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin: $ PATH

Export CLASSPATH = $ CLASSPATH:.: $ JAVA_HOME/lib: $ JAVA_HOME/jre/lib

4.Modify the system's default jdk.

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

$ Sudo update-alternatives -- install/usr/bin/javac/usr/lib/jvm/jdk1.7.0 _ 45/bin/javac 300

$ Sudo update-alternatives -- config java

$ Sudo update-alternatives -- config javac

5.Detection, input java-version

Java version "1.7.0 _ 45"

Java (TM) SE Runtime Environment (build 1.7.0 _ 45-b18)

Java HotSpot (TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

Reading:

Install JDK 7 (with Clojure download) http://www.linuxidc.com/Linux/2012-10/71557.htm under Ubuntu

Install JDK1.7 http://www.linuxidc.com/Linux/2012-06/62239.htm in Ubuntu 12.04

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.