I. preface the CentOS6.5 system comes with OpenJDK1.7, 1.6, and 1.5, but some OpenJDK content is not compatible with SUNJDK. Therefore, we plan to reinstall SUNJDK1.7 for development. 2. uninstall OpenJDK1. run the rpm command to view OpenJDK
I. Preface
CentOS6.5 comes with Open JDK 1.7, 1.6, and 1.5. However, some content of OpenJDK is not compatible with sun jdk. Therefore, we plan to reinstall sun jdk 1.7 for development.
II. uninstall Open JDK
1. run the rpm command to view the specific version of Open JDK.
# rpm -qa | grep java
The result may be
Tzdata-java-2012c-1.el6.noarchjava-1.7.0-openjdk-1.7.0.45-1.45.1.11.1.el6.x86_64
2. uninstall JDK through rpm
# rpm -e --nodeps tzdata-java-2012c-1.el6.noarch# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.45-1.45.1.11.1.el6.x86_64
The Open JDK has been uninstalled.
3. install SUN JDK1.7
1. download the tag.gz File (http://www.oracle.com/technetwork/java/javase/downloads/index.html)
2. copy to/opt directory and decompress
/* Copy */# cp jdk-7u67-linux-x64.tar.gz/opt // * unzip */# tar-zxvf jdk-7u67-linux-x64.tar.gz
3. configure global environment variables
Append the following content to the/etc/profile file:
# jdk7 settingsJAVA_HOME=/opt/jdk1.7.0_67JRE_HOME=$JAVA_HOME/jrePATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/binCLASSPATH=:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/libexport JAVA_HOME JRE_HOME PATH CLASSPATH
Run source/etc/profile to make the configuration take effect.
4. create a java soft link under the/sbin Directory
At this time, we enter the java command in shell, and the prompt/usr/bin cannot find the java command, that's because we haven't created a soft link for $ JAVA_HOME/bin/java in the/sbin directory.
ln -s /opt/jdk1.7.0_67/bin/java /sbin/java
The installation of SUN JDK1.7 has been completed!
4. install Tomcat 7
Tomcat has supported the Web Socket function since 7, so it is decided to use it!
1. download and decompress the package to the/opt directory.
2. add the following content at the top of the catalina. sh file:
export TOMCAT_HOME=/opt/apache-tomcat-7.0.55export CATALINA_HOME=/opt/apache-tomcat-7.0.55export JRE_HOME=/opt/jdk1.7.0_67/jreexport JAVA_HOME=/opt/jdk1.7.0_67
Run source catalina. sh to make the configuration take effect.