0

When I try to start uiautomatorviewer.bat i get this error:

ERROR: No suitable Java found. In order to properly use the Android Developer Tools, you need a suitable version of Java JDK installed on your system. We recommend that you install the JDK version of JavaSE, available here: http://www.oracle.com/technetwork/java/javase/downloads

If you already have Java installed, you can define the JAVA_HOME environment variable in Control Panel / System / Avanced System Settings to point to the JDK folder.

You can find the complete Android SDK requirements here: http://developer.android.com/sdk/requirements.html

I have a working JDK at C:\Program Files\Java\jdk-9

My system variables are:

JAVA_HOME C:\Program Files\Java\jdk-9

PATH C:\Program Files\Java\jdk-9\bin;D:\Prac\AndroidSDK\platform-tools\bin;D:\Prac\AndroidSDK\tools\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%ANDROID_HOME%;%ANDROID_HOME%\build-tools\25.0.3;D:\Prac\nodejs\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;

( ANDROID_HOME D:\Prac\AndroidSDK )

My java version:

java version "9" Java(TM) SE Runtime Environment (build 9+181) Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)

echo %JAVA_HOME% is working OK (printing correct path).

I tried setting JAVA_HOME variable in the .bat script. That didn't work. (But that might be because I'm not sure where exactly in the script should I include it...)

Do you have any idea how to solve this?

Jan Kl.
  • 69
  • 2
  • 13
  • Did you try reading https://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/ – Amit Mahajan Oct 24 '17 at 14:35
  • Thank you. Maybe it´s my english, but how is this document helpful to my situation? I have the JAVA_HOME variable set. Can you explain please? – Jan Kl. Oct 24 '17 at 14:46
  • The error "ERROR: No suitable Java found " means you have not set it properly. Check your version, see if you have multiple java home's . See if JRE HOME, Java Home etc are set properly. – Amit Mahajan Oct 24 '17 at 15:18
  • Path was OK. Problem was the 64bit version of JDK. Thanks. – Jan Kl. Oct 24 '17 at 15:33
  • Related: https://stackoverflow.com/questions/33367823/vs-android-not-suitable-java-found – Chanandler Bong Jan 24 '20 at 15:36

1 Answers1

0

Eureka! The problem was that I was using 64bit JDK.

After installation of 32bit version all I needed to do was to set ANDROID_SWT system variable and it is working now.

Jan Kl.
  • 69
  • 2
  • 13