2 problems (2 errors)make[2]: *** [bin/zabbix-java-gateway-2.0.2.jar] Error 255

一.编译安装Zabbix 报错
----------
1. ERROR in src/com/zabbix/gateway/BinaryProtocolSpeaker.java (at line 76)
        String request = new String(data, UTF8_CHARSET);
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The constructor String(byte[], Charset) is undefined
----------
2. ERROR in src/com/zabbix/gateway/BinaryProtocolSpeaker.java (at line 92)
        responseBytes = response.getBytes(UTF8_CHARSET);
                                 ^^^^^^^^
The method getBytes(String) in the type String is not applicable for the arguments (Charset)
----------
2 problems (2 errors)make[2]: *** [bin/zabbix-java-gateway-2.2.3.jar] Error 255
make[2]: Leaving directory `/data/software/zabbix-2.2.3/src/zabbix_java'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/data/software/zabbix-2.2.3/src'
make: *** [all-recursive] Error 1

二.问题分析

src/com/zabbix/gateway/BinaryProtocolSpeaker.java 
The method getBytes(String) in the type String is not applicable for the arguments (Charset)
jdk问题。需要安装满足Zabbix的高版本的jdk

三.问题解决

wget http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.tar.gz
tar zxvf jdk-7u55-linux-x64.tar.gz -c /usr/local
ln -s /usr/local/jdk1.7.0_55 /usr/local/jdk
echo 'JAVA_HOME=/usr/local/jdk' >> /etc/bashrc
echo 'PATH=${JAVA_HOME}/bin/:$PATH' >> /etc/bashrc
echo 'export JAVA_HOME PATH' >> /etc/bashrc
source /etc/bashrc

四.重新编译安装zabbix

你可能感兴趣的:(zabbix)