ElasticSearch installation error with CLASSPATH - elasticsearch

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.

Related

Elastic Search Immediately Dies on Mac

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

Error installing eclipse (jvm.dll load error) - how to fix?

I am trying to install Eclipse inside a virtual machine running Windows 7 64-bit.
When I launch eclipse-inst-win64.exe, I get the following error: Failed to load the JNI shared library "C:\Program Files\Java\jdk-12.0.2\bin\server\jvm.dll.
Both eclipse and JDK are 64-bit.
The DLL is there:
c:\>dir "c:\Program Files\Java\jdk-12.0.2\bin\server\jvm.dll"
Volume in drive C has no label.
Volume Serial Number is 8E3B-94B
Directory of c:\Program Files\Java\jdk-12.0.2\bin\server
07/27/2019 04:47 PM 11,538,912 jvm.dll
Java is 64-bit:
c:\>"c:\Program Files\Java\
jdk-12.0.2\bin\java.exe" -version
java version "12.0.2" 2019-07-16
Java(TM) SE Runtime Environment (build 12.0.2+10)
Java HotSpot(TM) 64-Bit Server VM (build 12.0.2+10, mixed mode, sharing)
No other JDK or JRE versions are installed.
Java itself works just fine - I compiled and ran few Spring samples, installed and used Maven, everything works.
Any idea what can be wrong here? Is there any way to force Eclipse to output more info about the error (e.g. the value returned by GetLastError() in the Windows API after loading the library failed).
Thanks!
I solved the problem by downloading and installing the Visual C++ 2015 runtime from Microsoft.
Apparently it's needed for that specific jvm.dll and isn't installed automatically by the JDK installer.

Why cmd give error when we open uiautomatorviewer?

When I run the following command in the command prompt that time I am getting the following error.
Command: C:\Users\ob>uiautomatorviewer
Error:
-Djava.ext.dirs=..\lib\x86_64;..\lib is not supported.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Set your all android path properly.
Add variable in system environment as mention below.
ANDROID_SWT : C:\Users\chetan\AppData\Local\Android\Sdk\tools\lib\x86_64
ANDROID_HOME : C:\Users\chetan\AppData\Local\Android\Sdk
ANDROID_PLATFORM_TOOLS : C:\Users\chetan\AppData\Local\Android\Sdk\platform-tools
Add below mention Path in Path Variable in system environment.
C:\Program Files\Java\jdk\bin;
C:\Users\chetan\AppData\Local\Android\Sdk\tools\bin;
C:\Users\chetan\AppData\Local\Android\Sdk\tools;
C:\Users\chetan\AppData\Local\Android\Sdk\platform-tools;
C:\Program Files\nodejs\node_modules\npm\bin;
C:\Users\chetan\AppData\Local\Android\Sdk;
C:\Users\chetan\AppData\Local\Android\Sdk\tools\lib\x86_64\swt.jar;
Pre-Check - Verify the java Version installed in your system.
VERIFY - java -version
java version "1.8.0_221" Java(TM) SE Runtime Environment (build
1.8.0_221-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)
If this message appears that means you have JAVA 8 install and uiautomatorviewer only supports till JAVA 8.
So install JAVA 8 from here and if you already have JAVA install down grade it to JAVA 8

Error while installing spark

I am trying to install spark in windows 8.1 and getting below error.
C:>cd Program Files\spark-1.5.0\bin
C:\Program Files\spark-1.5.0\bin>spark-shell
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
C:\Program Files\spark-1.5.0\bin>
and done prerequisites,please refer below commands,
C:\Users\Anbu>java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
C:\Users\Anbu>scala -version
Scala code runner version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL
C:\Users\Anbu>
set the system properties also.
so where i missed? why this error coming?
Any one please help me to install spark.
Thanks,
Anbu k
It seems you downloaded source code package of Spark.
For installations you need built package of Spark. You can download pre-built package of Spark from Sparks's downloads page by choosing a specific package type(as shown in below image). So download pre-built package and check the installation. It should work.

Trouble getting Elasticsearch to run

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

Resources