Installing JDK under Linux

Source: Internet
Author: User

1) Use uname-a to see that the machine is in the first place.



2) JDK official network http://www.oracle.com/technetwork/java/javase/downloads/index.html Download


3) Unzip the installation

We install the JDK to this path:/USR/LIB/JVM

If there is no such directory (the first time of course not), we will create a new directory

Cd/usr/lib

mkdir JVM

Then unzip the compressed package that you just downloaded

Tar zxvf./jdk-7-linux-i586.tar.gz-c/USR/LIB/JVM

Cd/usr/lib/jvm

MV Jdk1.7.0_05/jdk7

4) Configure Environment variables

Vi/etc/profile

Add the following lines at the end:

Export JAVA_HOME=/USR/LIB/JVM/JDK7

Export JRE_HOME=${JAVA_HOME}/JRE

Export Classpath=.:${java_home}/lib:${jre_home}/lib

Export Path=${java_home}/bin: $PATH

Source/etc/profile effective after execution

5) test JDK

#vi Hello.java

public class Hello {

public static void Main (String args [])

{

System.out.println ("Hello world!");

}

}

# Javac Hello.java

# java Hello


Installing JDK 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.