Logstash install error in ubuntu

UPDATE:
I have installed OpenJDK8 as mentioned in Logstash 7 install error Ubuntu 18.04
Updated JAVACMD in /etc/logstash/startup.options as below.
JAVACMD=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java

Then getting this error.

sudo /usr/share/logstash/bin/system-install
Unrecognized option: --module-path
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Unable to install system startup script for Logstash.