Linux (Centos) installation Java JDK and considerations

Source: Internet
Author: User

1. Preparatory work

A. Since the Java JDK distinguishes between 32-bit and 64-bit systems, it is important to determine how many of our CentOS systems are installed before installing the following commands:

uname-aExplanation: If there is a x86_64 is 64 bit, not is 32 bit. The following is X686 or x86_64 the kernel is 64 bits, i686 or i386 the kernel is 32 bits    This makes it possible to judge my CentOS as a 32-bit system, so I need to download the JDK for the 32-bit system. b. Download JDK, Address: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html, I downloaded the JDK for 8,:      c. The required software and system are as follows: Virtual machine (Vmware), CentOS system installed in virtual machine, xshell,xftp,jdk-8u65-linux-i586.gz2. Installing Java JDK8.0

A. With the above preparation, we now have an environment where we can install the JDK.

B. Then use the command in Xshell to jump to the local creator's own folder: KenceryB.1 CD usr/local/mkdir kencery CD kencery/c. Then use XFTP to copy the JDK to the Kencery folder:D. Unzip the uploaded JDK and rename it to JAVAJDK after decompression:D.1 tar-zxv-f jdk-8u65-linux-i586.gzD.2 mv jdk1.8.0_65 javajdkD.3 CD JAVAJDK    E. With the above steps, our JDK has all been installed and the next step is more important: Configure environment Variables 3. Configure Environment variables

A.1 Vim/etc/profile

A.2 After opening the key tray (i) into the edit mode, copy the contents below to the bottomJAVA_HOME=/USR/LOCAL/KENCERY/JAVAJDK
path= $JAVA _home/bin: $PATH
classpath= $JAVA _home/jre/lib/ext: $JAVA _home/lib/tools.jar
export PATH java_home CLASSPATHNote: According to the above configuration information, we can not only configure the environment variables to complete, it should be noted that the path in the configuration of the oh, we must put the ava_home/bin in front, or use Java command, the system will find the previous Java, in not looking down, In this way, the JAVA executable file run directory is not $java_home/bin, and in other directories, will cause a lot of problems.   A.3 After writing, we press the keyboard (ESC) button to exit, then press (: WQ) to save and turn off vim. B. After the configuration is complete, the most important step is to make the file effective immediately: The command is as follows:Source/etc/profile Let profile3. Verify that the installation is successfulA. After all the above steps have been completed, we need to check if the installation is successful and enter the following command:A.1 java-versionA.2 Echo $JAVA _home      This blog here we have finished, if you have questions, welcome message, we study together, to learn Linux I am also a beginner, I hope you encourage, thank you. The above content from the Internet, I arrange to publish here, if there are copyright issues, please contact me to delete, thank you.    Next Blog We will use Linux to build Tomcat and release Javaweb project, in the experiment I encountered a lot of problems, I will share in the next section to everyone, look forward to.

Linux (Centos) installation Java JDK and considerations

Related Article

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.