I know that there is some topic about it already, but still can't fix it.
I used this tutorial to install ES6
I got "JAVA_HOME" error so before exported JAVA_HOME .
bitnami@bitnami-magento-b4b5:/$ export JAVA_HOME=/opt/bitnami/java
bitnami@bitnami-magento-b4b5:/$ export PATH=$PATH:$JAVA_HOME/bin
bitnami@bitnami-magento-b4b5:/$ $JAVA_HOME
-bash: /opt/bitnami/java: Is a directory
bitnami@bitnami-magento-b4b5:/$ sudo systemctl start elasticsearch.service
bitnami@bitnami-magento-b4b5:/$ sudo systemctl status elasticsearch.service
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2020-06-09 05:18:40 UTC; 5s ago
Docs: http://www.elastic.co
Process: 6548 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
Main PID: 6548 (code=exited, status=1/FAILURE)
Jun 09 05:18:40 bitnami-magento-b4b5 systemd[1]: Started Elasticsearch.
Jun 09 05:18:40 bitnami-magento-b4b5 elasticsearch[6548]: warning: Falling back to java on path. This behavior is deprecated. Specify JAVA_HOME
Jun 09 05:18:40 bitnami-magento-b4b5 elasticsearch[6548]: could not find java; set JAVA_HOME
Jun 09 05:18:40 bitnami-magento-b4b5 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Jun 09 05:18:40 bitnami-magento-b4b5 systemd[1]: elasticsearch.service: Unit entered failed state.
Jun 09 05:18:40 bitnami-magento-b4b5 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
My java version
bitnami@bitnami-magento-b4b5:/$ java -version
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.232-b09, mixed mode)
JAVA_HOME path is set is correct?
bitnami@bitnami-magento-b4b5:/opt/bitnami/java$ ls -l
total 184
-r--r--r-- 1 root root 1522 Oct 18 2019 ASSEMBLY_EXCEPTION
drwxr-xr-x 2 root root 4096 Apr 22 05:37 bin
drwxr-xr-x 2 bitnami root 4096 Apr 29 05:38 bitnami
drwxr-xr-x 9 root root 4096 Apr 22 05:37 lib
-r--r--r-- 1 root root 19274 Oct 18 2019 LICENSE
-r--r--r-- 1 root root 148619 Oct 18 2019 THIRD_PARTY_README