(Original) installation and configuration of the Java environment in centos Linux (centos + jdk1.6.0 _ 11)

Source: Internet
Author: User

1. download Java
Web: http://www.oracle.com/technetwork/java/javase/downloads/index.html
I got a jdk-6u43-linux-i586.bin.

Ii. Installation
1. I created a Java folder under OPT.
# Mkdir/opt/Java

2. I used winscp to put the JDK file under the/usr/Java folder.
Run the following command:
# Cd/opt/Java
# Chmod A + x jdk-6u43-linux-i586.bin
Give the current user permission to execute the jdk-6u43-linux-i586.bin;

3. Install
#./Jdk-6u43-linux-i586.bin
Run the jdk-6u43-linux-i586.bin, it will show the JDK installation license agreement, flip by space, finallyProgramI will ask you if you agree with the above Agreement. Of course you agree. Enter "yes" and decompress JDK to the current directory. The decompression progress is displayed on the screen.
After decompression, a directory named "jdk1.6.0 _ 43" will be created under the/opt/Java directory. Now we have installed JDK under centos.
4. Open/etc/profile in a text editor
# Vi/etc/profile
Add the following lines at the end:
Export java_home =/opt/Java/jdk1.6.0 _ 43
Export classpath =.: $ java_home/JRE/lib/RT. jar: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
Export Path = $ path: $ java_home/bin

Iii. delete/uninstall
Run the # rm-fr jdk1.6.0 _ 43 command to delete the JDK. Do not forget to clear the configuration file.

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.