1. First download jdk1.8 from the official website
2. jdk configuration
Edit the profile in the etc directory and enter sudo vim etc/profile
Recommended related video tutorials: java course
Press Enter to get the following picture:
3. Press i or insert to insert the following content at the end of the file
Note that you only need to change the path of Javah_home
#Java Env export JAVA_HOME=/usr/jdk1.8.0_121 export CLASSPATH=.:JAVAHOME/lib/dt.jar:JAVA_HOME/lib/dt.jar:JAVA H OME/lib/dt.jar:JAVA_HOME/lib/tools.jar export PATH=PATH:PATH:PATH:JAVA_HOME/bin
Get the following picture:
##After inserting, press Esc to exit editing, enter: wq and press Enter 4. Finally enterJava -version to check whether it is configured properly
The above is the detailed content of How to install jdk1.8 under linux system. For more information, please follow other related articles on the PHP Chinese website!