Why cmd give error when we open uiautomatorviewer? - android-uiautomator

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

Related

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.

ElasticSearch installation error with CLASSPATH

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.

Installing elasticsearch, getting error

I'm trying to install elastic search. Downloaded the bat file form here:
https://www.elastic.co/downloads/elasticsearch
I'm getting following error:
D:\elasticsearch\bin>elasticsearch.bat
Error: Could not find or load main class D:\elasticsearch\lib\elasticsearch-cli
6.2.4.jar
The jar is already there under lib.
My java version is:
D:\elasticsearch\bin>java -version
java version "1.8.0_141"
Java(TM) SE Runtime Environment (build 1.8.0_141-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.141-b15, mixed mode)
Any idea why I'm getting this error?

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.

Java version shows 7 and Java version shows 8 in windows?

I am really frustrated to see following behavior and not sure yet after research how to fixed this. I've two separate projects one works only on Java 7 (can't update to Java 8) and another project works on Java 8 (can't downgrade to 7). So I've both Java 7 and 8 installed on my windows machine.
So, I am seeing following behavior constantly. Currently I am on Java 8 and would like switch back Java 7, so I changed environment variable JAVA_HOME and PATH to point to Java 7, but when I verify through CMD, it shows me following.
C:\>java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
C:\>javac -version
javac 1.7.0_71
I can't use above combination, neither projects works for me. So I always need to uninstalled Java 8 and then only I can point to Java 7.
Also if I want to move back to Java 8 (again installed Java 8), then it shows me following combination. How to fixed this error on Windows? As uninstalling the JDK every time is not the solution. Please help me.
C:\>java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
C:\>javac -version
javac 1.8.0_45
java.exe, the Java runtime, also installs in c:\windows or c:\windows\system32 (can't remember, I'm on a Mac now).
So even if your PATH contains the bin directory of JDK, if c:\windows (or c:\windows\system32) comes before JDK\bin in the PATH, the version in c:\windows (or c:\windows\system32) is the one that is used.
Just make sure the JDK is first in the PATH, or at least before c:\windows (or c:\windows\system32).

Resources