Configure the Java environment in centos

Source: Internet
Author: User

Step 1: Check whether the built-in JDK of Linux is installed (uninstall centos 1.4 installed)
<1> # rpm-Qa | grep JDK plugin to view JDK information or directly execute
Or
# Rpm-Q JDK
Or
# Java-version
<2> # rpm-Qa | grep gcj release confirm the gcj version number
<3> # Yum-y remove java-1.4.2-gcj-compat uninstall gcj

Step 2: Install JDK
<1> download jdk-1_5_0_14-linux-i586-rpm.bin or jdk-1_5_0_14-linux-i586.bin from sun
Create a Java folder under/USR and put the installation package in the/usr/Java directory.
# Mkdir/usr/Java
<2> install JDK
# Cd/usr/Java
① Install jdk-1_5_0_14-linux-i586-rpm.bin files
# Chmod 777 jdk-1_5_0_14-linux-i586-rpm.bin supervisor modified to Executable
#./Jdk-1_5_0_14-linux-i586-rpm.bin accept select YES to agree to the above agreement
# Rpm-IVH jdk-1_5_0_14-linux-i586.rpm configure Select Yes until installation is complete
② Install jdk-1_5_0_14-linux-i586.bin files
# Chmod A + x jdk-1_5_0_14-linux-i586.bin grants the current user permission to execute
#./Jdk-1_5_0_14-linux-i586.bin plugin Select Yes until installation is complete

Step 3: Configure Environment Variables
<1> # vi/etc/profile
<2> Add the following lines at the end:
Export java_home =/usr/Java/jdk1.6.0 _ 10
Export classpath =.: $ java_home/JRE/lib/RT. jar: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
Export Path = $ path: $ java_home/bin
<3> # source/etc/profile restart

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.