Install jdk--JDK installation under Linux

Source: Internet
Author: User

One of the essential skills of a Java software engineer: installing JDK under Linux

Installing the JDK on Linux is one of the most essential technologies for programmers who choose to develop applications under Linux, and here I use Ubuntu demo to install Jdk1.7 under Linux using the command line (graphical interface is not considered!!!). )

First step: Install the virtual machine

Step Two: Install Ubuntu

Step three: Install the JDK

Resources:

Ubuntu 10 (my 32-bit machine, everyone attention to the seat)
Linux ubuntu 2.6.35-22-generic #33-ubuntu SMP Sun Sep 20:34:50 UTC i686 gnu/linux

Jdk1.7 version

Jdk-7u9-linux-i586.tar.gz

(1), JDK people generally like to think of it as a system application, so generally everyone likes to create a new folder under/usr/----Java is used to store the Java installation path

Action command: sudo mkdir/usr/java

(2), the downloaded JDK mounted, (Mount resources: Virtual Machine-"Settings-" option-"shared files always open-" Add the resources that need to be mounted, and finally in the virtual machine/mnt/hgfs/ can view attached resources) Here, I put my jdk-7u9-linux-i586.tar.gz in.

(3), unzip the jdk-7u9-linux-i586.tar.gz and place it in the/usr/java directory and then rename it to jdk1.7

Extract command: sudo tar-zxvf-r jdk-7u9-linux-i586.tar.gz//usr/java

Rename command: sudo mv jdk1.7.0_09 jdk1.7

(4), configure environment variables

Enter configuration file: Vi/etc/profile

Add a configuration file before Umask 022

Export java_home=/usr/java/jdk1.7

Export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

Export path= $PATH: $JAVA _home/bin

Umask 022

(5), and finally restart the client input java-version the message that appears is the success

[email protected]: ~$ java-version
Java Version "1.7.0_09"
Java (TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot (TM) Client VM (build 23.5-b02, Mixed mode)
[email protected]: ~$

Install jdk--JDK installation under Linux

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.