1、 First check if java is installed on the current system
After entering the command, see if there is any version data
2、 If there is a version to uninstall using rpm -e --nodeps
Upload jdk to /usr/local directory
download link
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
3、 Use the unzip command after uploading
tar -zxvf /usr/local/jdk version
4、 Perform jdk variable configuration
vi /etc/profile
Add at the end
JAVA_HOME=/usr/local/jdk1.8.0_201CLASSPATH=.:
5、 Next press esc
Enter: wq save
6、 Reload configuration file
source /etc/profile
7、 Check whether the jdk is installed successfully
Enter javac or java -version
Just have data
Recommended Posts