java.security.KeyException的解决
程序调用环信的接口时,出现此异常。
环境:centos ,openjdk 7,tomcat
原因:open jdk引起,换成sun jdk即可
1 下载 wget http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.rpm?AuthParam=1461068501_c0dc3de76df5de5dd76b2d1795333e57
2 设置文件权限
chmod 777 jdk-7u79-linux-x64.rpm
3 yum install jdk-7u79-linux-x64.rpm
4 java -version
java version “1.7.0_79”
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
启动tomcat,服务正常了
open jdk的卸载:
rpm -qa | grep jdk
java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.i686
卸载
yum -y remove java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.i686