I downloaded elastic search today. When I try to run it, it is immediately killed with the following message:
Johnathans-MacBook-Pro:Downloads jward$ ./elasticsearch-7.6.1/bin/elasticsearch
./elasticsearch-7.6.1/bin/elasticsearch-env: line 71: 12909 Killed: 9
"$JAVA" -cp "$ES_CLASSPATH" org.elasticsearch.tools.java_version_checker.JavaVersionChecker
My java version is:
java version "11.0.6" 2020-01-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.6+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)
Why won't the elastic search service start?
Elasticsearch isn't able to recognize your Java version and that's the reason it is failing. Please see in your logs, the error is thrown from the below class and you can have a look at from below source code.
https://github.com/elastic/elasticsearch/blob/master/distribution/tools/java-version-checker/src/main/java/org/elasticsearch/tools/java_version_checker/JavaVersionChecker.java#L28 and you can have a look at this class, All it does is checks if the runtime Java version is at least 1.8..
In your case its java 11, so java version isn't a problem, the problem lies in Elasticsearch not recognizing that.
You need to set proper JAVA_HOME in your ~/.zshrc if using latest Mac OS Catalina, as they moved to ~/.zshrc and I see you just mention JAVA_HOME=$(/usr/libexec/java_home) but don't see EXPORT before this. So please add below line.
EXPORT JAVA_HOME=$(/usr/libexec/java_home)
After that source ~/.zshrc and then close the terminal and see the output of java -version , if it shows java 11 version then you are good to go and run the elasticsearch again.
Hope this helps and let me know if you have further questions.
If your java version is different from the one that comes with Elasticsearch bundle, it'll not start. Refer to the document below:
https://www.elastic.co/guide/en/elasticsearch/reference/current/setup.html
Related
I am getting the below mentioned error when i am trying to install elastic search version 6.6.0 on my windows 10 OS. The command i am using to install is
-- Command:
elasticsearch -Ecluster.name=TestES -Enode.name=First_Node
-- Error:
\Java\jre-9.0.4\bin\java.exe" -cp "!ES_CLASSPATH!" "org.elasticsearch.tools.launchers.TempDirectory""` was unexpected at this time.
-- Java Version install on my pc:
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
Please guide how to fix this issue.
Regards
Qasim
Same issue i was getting on my machine.
I then found issue was related to 32 bit Java was installed instead of 64 bit, i reinstalled and it started working fine.
if your java is installed under C:\Program Files (x86) then set the JAVA_HOME like will below
set JAVA_HOME=C:\Progra~2\Java\jre1.8.0_131
if your java is installed under C:\Program Files then set the JAVA_HOME like will below
set JAVA_HOME=C:\Progra~1\Java\jre1.8.0_131
After that try to start the elastic search, it should start then.
Thanks & Regards
Jaiswar Vipin Kumar R.
I have searched several ways to change JDK version on mac.
$/usr/libexec/java_home
And I got
/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home
I tried
$export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home
also tried
/usr/libexec/java_home 1.8.0_31 --exec javac -version
then I run
$echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home
then I re-check java -version
$java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
How I can really change java -version on my mac.
To set Java to 1.8 for your shell environment, put this in your ~/.bash_profile:
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
Solution without 3rd party tools:
leave all JDKs at their default location, under /Library/Java/JavaVirtualMachines. The system will pick the highest version by default.
To exclude a JDK from being picked by default, rename its Contents/Info.plist to Info.plist.disabled. That JDK can still be used when $JAVA_HOME points to it, or explicitly referenced in a script or configuration. It will simply be ignored by system's java command.
System launcher will use the JDK with highest version among those that have an Info.plist file.
When working in a shell with alternate JDK, pick your method among existing answers (jenv, or custom aliases/scripts around /usr/libexec/java_home, etc).
While trying to install Informix's JDBC driver, I get this error:
java -cp /home/ics/sandbox/jdbc/setup.jar run -console
The wizard cannot continue because of the following error:
could not load wizard specified in /wizard.inf (104)
I have pointed to a newer Java from Sun using:
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_05
export PATH=$JAVA_HOME/bin:$PATH
java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) Server VM (build 25.5-b02, mixed mode)
Pointing to a newer Java and, as IBM/Informix support told me, getting away from OpenJDK should allow the installer to run, but that does not work. I also saw using Sun's or IBM's java elsewhere, when I searched for posts on the specific error. On another Centos System, OpenJDK is installed, and I can install the JDBC driver successfully
I also tried removing tty settings from my environment, which also did not work.
Here is the so post where this error is mentioned.
If anyone has heard of a solution, I'd love to hear it, 'cause without the jdbc driver, there's no Clojure database work with Informix, and, when working, it works well. And, I have thought of tarring and zipping the good install and moving it, but that's kind of cheating.
This problem occurs on
cat /etc/redhat-release
CentOS release 6.4 (Final)
The installed java version, not my workaround newer version is
java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.11.90) (rhel-1.62.1.11.11.90.el6_4-i386)
OpenJDK Server VM (build 20.0-b12, mixed mode)
Until an answer arrives that allows an install, I took #MichaĆ Niklas 's suggestion and manually installed the driver under /opt/ on the new system. This worked.
I am still going to pursue the cause of this problem. I edited the OP to reflect #ceinmart 's suggestion to remove tty settings. This did not work, but I found it a useful suggestion.
I am trying to get Elasticsearch to run but unable to. Running ./bin/elasticsearch yields the following error:
Initialization Failed ...
- MissingResourceException[Can't find bundle for base name org.elasticsearch.common.joda.time.format.messages, locale en]
I'm running Mac OSX 10.8.2 and java -version yields:
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
Any ideas on what the problem is? I also trying running the ./bin/elasticsearch.in.sh script before but nothing has worked
It turns out the file on the elasticsearch website was messed up or had a bad download. I downloaded the tar.gz version and it worked.
I had the similar issue with both Elasticsearch 1.7 & Elasticsearch 2.0 on Mac OSx 10.10 Yosemite. I messed around with installing Java 8's JRE without success.
I ended up installing the Java 8 JDK in addition to the JRE based on this answer.
Additionally here's Elasticsearch's instructions
It seems, with the latest MAcOs updates, that Java was also updated, which influenced PhpStorm performance very badly.
Anyway, I decided to update my Java.
Was
$ java -version
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)
After downloading Java SDK from Oracle and installing:
$ java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
But in PhpStorm it still shows the old JRE:
I also restarted my computer, but still the old JRE is shown.
Please help, how to make PHPStorm use a new JRE?
Quoting from the "Selecting the JDK version the IDE will run under" article in the Knowledge Base
posted on March 27, 2013
Mac OS X
At the moment all our products require Apple JDK 1.6 to be installed in order to run on Mac. JDK 1.7 from Oracle is not officially supported yet and has known problems that stop us from using it by default. Oracle JDK 1.7.0_40 has added support for Retina and works much better than previous versions on Mac. You are welcome to give it a try in case you have any problems with Apple JDK.
To force running under JDK 1.7 edit /Applications/.app/Contents/Info.plist file, change JVMVersion from 1.6* to 1.7* :
<key>JVMVersion</key>
<string>1.7*</string>
See this answer for the known problems with JDK 1.7.
IDEA_JDK environment variable can be used to override the selected JDK, you may need to run the product from the Terminal so that it sees your environment variables (Mac OS limitation): open -a /Applications/.app/ .
Application About dialog will show the actual JDK version.