Let's start by getting the gateway up and running. If you installed from packages, there's likely a Java gateway package available; just install that one. If you installed from source, the Java gateway can be compiled and installed by running the following from the Zabbix source directory:
$ ./configure --enable-java && make install
If the compilation fails because it is unable to find javac, you might be missing Java development packages. The package name could be similar to java-1_8_0-openjdk-devel. Consult your distribution's documentation for the exact package name.
By default, when compiling from source, Zabbix Java gateway files are placed in the /usr/local/sbin/zabbix_java directory. From here on, we will use files found in that directory. If you installed from packages, consult the package configuration information...