Error: Could not find or load main class org.elasticsearch.tools.JavaVersionChecker

Same Jar file is working in MAC. but it is not working in Centos 7.
alternatives --config java

There are 3 programs which provide 'java'.

Selection Command

  • 1 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64/jre/bin/java)
    2 java-1.7.0-openjdk.x86_64 (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64/jre/bin/java)
  • 3 /usr/java/jdk1.8.0_73/jre/bin/java

Enter to keep the current selection[+], or type selection number: 1

I Try to install zip (5.3.2) file in centos 7 machine:
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-514.el7.x86_64
Architecture: x86-64
I changed to openjdk version "1.8.0_102"
OpenJDK Runtime Environment (build 1.8.0_102-b14)
OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode)

still i got this error: [siva@kfos-vmelk-1 bin]$ ./elasticsearch
Error: Could not find or load main class org.elasticsearch.tools.JavaVersionChecker
Elasticsearch requires at least Java 8 but your Java version from /bin/java does not meet this requirement