I'm trying to set up the android-sdk but the sdkmanager won't show up.
because of this Error massage i cheked my JAVA_HOME variable, witch is pointing correctly to the jdk instalation:
if i run
echo %JAVA_HOME%
in cmd i get
C:\Program Files\Java\jdk-10.0.1
this is the output of android.bat
C:\Android\sdk\tools>android.bat
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
C:\Android\sdk\tools>
If java downgrade didn't work for you try this
After long struggle I was able to figure out the issue, Not sure if this is a valid fix but that did fix it.
In the latest Android studio version 3.4 in
C:\Users\username\AppData\Local\Android\Sdk\tools\lib\find_java.bat on line 44
it looks like this
for /f "delims=" %%a in ('"%~dps0\find_java%arch_ext%.exe" -s') do set java_exe=%a%
if you give
echo of %~dps0\find_java%arch_ext%.exe
this line it is supposed to print the path of the find_java32.exe or find_java64.exe based on your machine architecture but it adds // slashes in the path just before final finde_javax.exe which was causing an issue.
so I just modified it to look like below and it worked.
" for /f "delims=" %%a in ('"%~dps0%find_java%arch_ext%.exe" -s') do set java_exe=%a% "
Do let me know if there is a better solution or if this works for you
@Saravinfotech's answer didn't work for me but it pointed me at the right place. The double \ still called find_java64.exe for me, but running that:
$ .\find_java64.exe -e
Failed to find Java 1.6 (or newer) on your system. [2] The system cannot find the file specified.
Even though java.exe was on my path and JAVA_HOME was set to my oraclejdk\current folder. Not worth debugging though.
I just patched the script with these additions:
set java_exe=%JAVA_HOME%\bin\java.exe
set javaw_exe=%JAVA_HOME%\bin\javaw.exe
and the script stopped complaining.
Looking back, there might be bigger problems going on. monkeyrunner.bat is calling java.exe with arg-Djava.ext.dirs instead of -classpath which isn't supported as of JDK9 (?), and even working around that, I'm getting NoClassDefFoundError. A recent release of Java 14 seems very incompatible.
Installing JDK8 was the fix.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With