Centos 6 x86_64 server configuration JAVA environment
System Environment: Centos 6 x86_64
Install Java
[root@localhost /]# yum -y install java
View JAVA version
[root@localhost /]# java -version
View java list
[root@localhost /]# yum -y list java*
Install JDK
[root@localhost /]# yum -y install java-1.8.0-openjdk*
The version numbers after java can be replaced by the latest java version found in the previous step.
Check whether the installation is successful
[root@localhost /]# java -version
Or
[root@localhost /]# javac
Note: If you have experience configuring JAVA in Windows, remember to configure JAVA_HOME; PATH; CLASSPATH and other system paths. JDK in CentOS does not need to configure paths.
[root@localhost /]# echo $JAVA_HOME[root@localhost /]# echo $PATH[root@localhost /]# echo $CLASSPATH
After executing the command, you can directly see the configuration of environment variables such as JAVA_HOME in the environment.
At the same time
[root@localhost /]# echo $JAVA_HOME
It is also a method for querying jdk paths.