5.1. CentOS@ install JDK1.8 graphic tutorial
One, the first method windows download##
1. Download the tar package of jdk###
Website: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2. Click Accept License Agreement
3. Select jdk-8u171-linux-x64.tar.gz to download###
4. Waiting...
5. Downloaded
6. Open VMware, select the virtual machine you want to use, and click to open this virtual machine###
7. For removable devices that pop up, tick Don’t show this reminder and click OK###
8. Minimize the virtual machine and leave it alone
9. Open xshell, select the session corresponding to the virtual machine ip, and click connect
10. The connection is successful
11. Check whether jdk has been installed through the rpm -qa | grep java command
12. My display is not installed. If it is installed, use the rpm -e xxx --nodeps command to load and unload. xxx means the name of the installation package you found through the rpm -qa | grep java command
12. Return to the root directory by cd / command###
13. Enter the local directory under the usr directory under the root directory through the cd usr/local/ command. This directory is for storing some local shared resources
14. Use the ll command to check the directory structure in the current directory. The ll command is short for the ls -l command, which is equivalent to the dir command in dos
15. Create a directory named java in the current directory with the mkdir java command###
16. Use the ll command to check the directory structure in the current directory, the java directory just created has
17. Enter the java directory through the cd java command###
18. Use the ll command to check the directory structure in the current directory###
19. Click on the window -->> Transfer the new file, and transfer the just downloaded jdk tar package to the CentOS7 system through the ftp protocol
20. The left side represents your computer system, and the right side represents the CentOS7 system
21. Find the download directory of your jdk tar package on the left###
22. Right-click on the file you want to transfer and click Transfer###
23. After the upload is successful, close the ftp transfer tool
24. Use the ll command to check the directory structure in the current directory, and a tar package named jdk-8u171-linux-x64.tar.gz appears
25. Decompress the tar package by tar -xvf jdk-8u171-linux-x64.tar.gz###
26. Use the ll command to check the directory structure in the current directory###
27. Delete the tar package through the rm -rf jdk-8u171-linux-x64.tar.gz command###
28. Use the ll command to check the directory structure in the current directory###
29. Clear the screen through the clear command, which is equivalent to the cls command in dos
30. Enter the jdk installation directory through the cd jdk1.8.0_171/ command###
31. Display the current directory through the pwd command, copy the current directory, because you will configure environment variables
32. Edit the configuration file of environment variables through the vim /etc/profile command###
33. Prompt that the command is not found. Install the vim text editor through the yum -y install vim command. I don’t use the vi text editor because I like highlighting###
34. Continue to edit the configuration file of environment variables through the vim /etc/profile command. Press the up key on the small keyboard to find the command you just entered, which is almost the same as dos
35. Press the down key of the small keyboard to come to the bottom of the configuration file###
36. Click the i button to enter the insert mode, and start a new line to be written into the environment variable configuration of java###
37. Write the following content, the value of JAVA_HOME is the path of the current directory displayed by the pwd command just now, if you forgot to see step 31###
export JAVA_HOME=/usr/local/java/jdk1.8.0_121
export CLASSPATH=.:JAVA_HOME/lib/tools.jar:JAVA_HOME/jre/lib/rt.jar
export PATH=JAVA_HOME/bin:PATH
38. Click the ESC key to exit insert mode
39. Click the: button, type wq and press Enter to save and exit, and: is ### in English
40. Clear the screen with the clear command
41. Use the source /etc/profile command to make the changed configuration take effect immediately
42. Use the java -version command and javac -version command to check whether the jdk is installed successfully
Second, the second method CentOS download
wget http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.tar.gz?AuthParam=1534129356_6b3ac55c6a38ba5a54c912855deb6a22
Third, the third method yum download
1、 Search jdk installation package
# yum search java|grep jdk
2、 Download jdk1.8, the default directory after downloading is: /usr/lib/jvm/
# yum install java-1.8.0-openjdk