1, http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
First go to download the linux jdk corresponding to java.
2. Use the ftp tool to upload to the /usr directory on the linux virtual machine.
3. Use the remote tool to link to the linux virtual machine, enter the /usr directory, and use the decompression command tar zxcf
Decompression
tar zxvf target compressed file
4, modify environment variables
sudo vi /etc/profile
Location, add:
#Java Env export JAVA_HOME=/usr/your java directory export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$PATH:$JAVA_HOME/bin
5. Exit the save and reload the configuration file
source /etc/profile
pre>
6. Verification version
java -version