- Go to the official website to download the Linux version of the JDK, if it is 64-bit, choose 64-bit, jdk-8u20-linux-x64.tar.gz.
- Unzip the downloaded JDK into the current directory, the decompression command is TAR-ZXVF jdk-8u20-linux-x64.tar.gz (CD to the current directory, such as my jdk-8u20-linux-x64.tar.gz on/home/hadoop/ Download/, then I will do cd/home/hadoop/download/) in terminal, will get a folder jdk1.8.0_20.
- Then move the jdk1.8.0_20 to the location you want, CD to the current directory, and then type MV jdk1.8.0_20/opt/lib64/, for example in the OPT directory
- The environment variable is then configured. Open the/etc/profile with VI and add it to the inside, the command is Vi/etc/profile
- Export JAVA_HOME=/OPT/LIB64/JDK1.8.0_20
- Export classpath= $JAVA _home/lib: $JAVA _home/jre/lib: $CLASSPATH
- Export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH
Finally in the terminal input java-version, if the appearance is 1.8 version, indicating that the installation is successful!!!
Installation of JDK1.8 under ultra-simple FEDORA20 (Linux)