--Turn from: http://www.cnblogs.com/hanyinglong/p/5025635.html
Description: I am using the Debian operating system to install, this article is very helpful, learned that Linux is not familiar with some commands, the article commands I did not run successfully:
Example command: CD usr/local/mkdir kencery CD kencery/No directory found after execution
I wrote this: Cd/usr/local/mkdir kencery The difference is that the front more "/" should be their own directory path problems.
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 and Debian systems are installed before installing the following commands:
Uname-a explained: 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 so I can judge my CentOS, Debian 64-bit system, so I need to download 64-bit system JDK. 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 the system are as follows: Virtual machine (Vmware), the CentOS system installed in the virtual machine, xshell,xftp,jdk-8u91-linux-x64.tar.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 local creator's own folder: Kencery B.1 CD usr/local/mkdir kencery CD kencery/c. Then use xftp to copy the JDK to Kencery Folder below,: D. Unzip the uploaded JDK and rename it to JAVAJDK after decompression: D.1 tar-zxv-f jdk-8u65-linux-i586.gz D.2 mv jdk1.8.0_65 JAVAJDK D.3 CD JAVAJDK E. With the above steps, our JDK has all been installed, followed by a more important step: Configuring 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 following content to the bottom java_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 CLASSPATH Note: According to the above configuration information, we can not only the configuration of 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, do not look down, so that 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 successful. After all the above steps are completed, we need to check if the installation is successful, enter the following command: A.1 JAV A-version A.2 Echo $JAVA _home 5. Uninstalling the JAVA JDK
A. First execute the command to view the version of the JDK under the server: The command is as follows: Rpm-qa|grep JDK
B. Then execute the command: yum-y remove Java java-1.6.0-openjdk-1.6.0.0-1.50.1.11.5.el6_3.x86_64 Delete each version of the above query.
Linux (Centos, Debian) installation Java JDK and considerations (RPM)