Installed 6.6 -- Could not find java; set JAVA_HOME or ensure java is in PATH

Hi,

I just installed Elastic Search 6.6. I ran it and it worked fine until I tried again a few hours later:

# /export1/opt/ELK_Bin/elasticsearch-6.6.1/bin/elasticsearch
which: no java in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin)
could not find java; set JAVA_HOME or ensure java is in PATH
[Dev root @ vm-63f1-8c50 /export1/opt/ELK_Bin]
# echo $JAVA_HOME
/export/opt/jdk/1.8.0_25l64/

The logs I got usually showed up on the console and now I can't even see what the larger issue is.
Java is installed and this has started up before. I'm not sure what went wrong...

That error is usually pretty conclusive, so it looks like something changed that means we can't find your java binary.

A few options to try:

  1. Has the JAVA_HOME variable been exported to child processes?
    Try the command below. If it doesn't find JAVA_HOME then you have a problem with your shell environment

    env | fgrep JAVA
    
  2. Does the JAVA_HOME variable point to a valid directory with a valid binary?

     ls -l $JAVA_HOME $JAVA_HOME/bin/java
    

My env is ubuntu. I have same problem.The first commandfgrep JAVA is not result.But the second command can find the java dir.
But, I still have the err Could not find java; set JAVA_HOME or ensure java is in PATH

You also asked at Could not find java; set JAVA_HOME or ensure java is in PATH in ubuntu which is I think the right place for your question. Let's keep the discussion there.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.