Install JDK and system configuration in CentOS 6

Source: Internet
Author: User


CentOS 6 installation of JDK and system configuration has always been a special liking for CentOS, but because it is rarely used, you should not forget it, and you should not remember it. Laziness is really not a good habit. Recently, the image version 6.3 is available. The mini installation is used for installation. Therefore, the system is very clean after installation. After the system is installed, we should set up the JDK environment. Now we can simply record the building process of the JDK environment. Www.2cto.com: "Because some CentOS versions install software such as OpenOffice by default, and these software requires Java support, the system installs a JDK environment by default, if you need to use a specific Java environment, it is best to uninstall or delete the default installed JDK. Take CentOS 5.4 as an example. After CentOS 5.4 is installed, enter "java-version" in the terminal. The system displays the current jdk version "java-1.6. -openjdk-1.6.0.0-1.7.b09.el5 ", we can see that jdk is using openjdk1.6. If you delete java, openoffice, and other related software directly in "Application -- add/delete software -- Basic System -- java" of centOS, it will be automatically deleted, therefore, it is best to install and configure the new jdk and the corresponding environment before deleting the original JDK. Install www.2cto.com: 1. First, download the corresponding JDK version from the official oracle website, here is the use of jdk-6u33-linux-x64.bin2, copy to the directory to install JDK (this example is/usr/local directory) 3, modify to execute: chmod 777 jdk-6u33-linux-x64.bin4, execute installation :. /jdk-6u33-linux-x64.bin5, installation is complete, you can see that the jdk1.6.0 _ 33 directory has been generated 6, delete the jdk-6u33-linux-x64.bin after the above steps, JDK has been installed, but also need to execute the following Configuration System Configuration: 1. Use VI to edit the profile file under/etc. 2. Add the JDK configuration information before the export command (you can also add it to the end of the file and configure it according to your habits). Example: export JAVA_HOME =/usr/local/jdk1.6.0.33 export CL ASSPATH =.: $ JAVA_HOME/jre/lib: $ JAVA_HOME/lib/tools. jar PATH = $ PATH: $ JAVA_HOME/bin export path user logname mail hostname... 3. Save and exit the VI editor. Run the source/etc/profile command to make the change take effect. 4. Run the java-version command to verify whether the system configuration takes effect. For example, [root @ xg ~] # Java-version java version "1.6.0 _ 33" Java (TM) SE Runtime Environment (build 1.6.0 _ 33-b04) Jave HotSpot (TM) 64-Bit Server VM (build 20.8-b03. mixed mode) [root @ xg ~] # Www.2cto.com now, the new JDK environment has been installed and configured. Next, delete the built-in JDK. First, enter the "rpm-qa | grep gcj" command in the terminal to view the gcj version. (If no result is displayed, the following operations can be ignored) here the result is: java-1.4.2-gcj-compat-1.4.2.0-40jpp.115 libgcj-4.1.2-48.e15 second, uninstall the built-in JDK system. Enter "yum-y remove java java-1.4.2-gcj-compat-1.4.2.0-40jpp.115" in the terminal and wait for the system to uninstall the built-in JDK. The "Complete" is displayed in the terminal, and the uninstallation is Complete. From BKJIA

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.