I. Preparation of documents
1.1 File name
Jdk-8u121-linux-x64.tar.gz
1.2
Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Second, tool preparation
2.1 Xshell
A powerful secure terminal emulation software that supports SSH1, SSH2, and the Telnet protocol of the Microsoft Windows platform.
Xshell's secure connection to remote hosts via the Internet and its innovative design and features help users enjoy their work in a complex network environment.
2.2 Xftp
A powerful sftp, FTP file transfer software based on the MS Windows platform.
With Xftp, MS Windows users can safely transfer files between Unix/linux and Windows PCs.
Third, the Operation procedure
3.1 Upload the downloaded JDK to the/usr directory via XFTP to the specified virtual machine
3.2 Connect to the virtual machine via Xshell, execute the following command to extract the file:
$ tar zxvf jdk-8u121-linux-x64.tar.gz
3.3 Setting environment variables using the VI Editor
$ sudo vi/etc/profile
At the end of the file, add the following:
#Java envexport java_home=/usr/jdk1.8.0_121export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/ Tools.jarexport path= $PATH: $JAVA _home/bin
3.4 Exit the VI Editor to make environment variable settings effective immediately
$ source/etc/profile
3.5 Viewing JDK versions
$ Java-versionjava Version "1.8.0_121" Java (tm) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot (tm) 64-bit Server VM (build 25.121-b13, Mixed mode)
Build the JDK inside the test environment with Linux commands