Install JDK in Linux

Source: Internet
Author: User

1. Installation

1) download JDK from the official website

Http://www.oracle.com/technetwork/java/javase/downloads/jdk6u38-downloads-1877406.html

I am here a 32-bit system, so download the jdk-6u38-linux-i586.bin binfile, after downloading, I put it under the/Softs directory

2) grant the executable permission to the Installation File

 
[Root @ localhost Softs]#Chmod + x jdk-6u38-linux-i586.bin

3) create a Java directory under the/usr directory

 
[Root @ localhost USR]#Mkdir Java

4) Go to the/usr/Java directory and execute

[Root @ localhost Java]#/Softs/jdk-6u38-linux-i586.bin

2. Configure Environment Variables

1) Open the/etc/profile file

 
[Root @ localhost USR]#VI/etc/profile

Add the following content at the end of the file:

 
Java_home =/usr/Java/jdk1.6. 0_38path=$ Java_home/Bin:$ PathClasspath= .:$ Java_home/Lib/Tools. jarexport java_homeexport pathexport classpath

Save and exit

2) execute the following statement to make the environment variable configuration take effect:

 
[Root @ localhost lib]#Source/etc/profile

3) Verify that the JDK installation and configuration are successful:

 
[Root @ localhost lib]#Java-versionJava version"1.6.0 _ 38"Java (TM) se Runtime Environment (build1.6.0 _ 38-B05) Java hotspot (TM) Client VM (build20.13-B02, mixed mode, sharing) [root@ Localhost lib]# 

3. Delete

If you want to delete the binary file, you can directly Delete the installation directory.

 
[Root @ localhost USR]#Rm-RF Java

 

 

 

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.