OS: Debian Stretch
Android Studio 3.4
JDK: open jdk 1.8
My Android studio build fails with following error:
Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.
I set JAVA_HOME, STUDIO_JDK etc and tried various tricks with openjdk , with no luck.
My default JRE is set to default as recommended
I am trying to update default JDK location as follow which given another error:
Already killed couple of hours to resolve this issue. So give android studio 3.4, my questions are:
- What is wrong with the built-in compiler ?
- Is openJDK 1.8 is valid jdk for android studio 3.4 to build/compile projects ? Or do I need Oracle-jdk?
- I see oracle-jdk licensing has changed, can I use that for building commercial apps ?
Edit
I found later that the issue was , debian stretch installed jvm only. I tried to run javac -version
which fails since by default stretch got jre only. Later I fixed by installing openjdk-8-jdk which fixed the issue:
sudo apt-get install openjdk-8-jdk
javac -version
javac 1.8.0_212