I can't seem to get my Android applications to compile due to a really annoying exception from Android Studio:
Execution failed for task ':myapp-services:compileDebugJava'.
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'm on Ubuntu 12.04, and I'm running Oracle's Java 7 JRE/JDK.
In ~/.bashrc
:
export JAVA_HOME="/usr/lib/jvm/java-7-oracle/"
In android-studio/bin/studio.sh
:
export JAVA_HOME="/usr/lib/jvm/java-7-oracle/"
Output of javac -version
:
javac 1.7.0_51
Output of java -version
:
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
Output of printenv JAVA_HOME
:
/usr/lib/jvm/java-7-oracle
Output of which javac
:
/usr/bin/javac
I have also logged out and logged back in again to my session.
I'm really not sure what I'm missing here. Why can't Android Studio compile my application?