I installed a fresh copy of Android Studio using terminal but when i create a new project it gives the error "Could not determine Java Version". JDK and SDK both are installed. Android Studio is updated to the latest version. I am using Ubuntu 14.04 LTS
Change this:
targetCompatibility 'JavaVersion.VERSION_1_8'
sourceCompatibility 'JavaVersion.VERSION_1_8'
to this:
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
I faced the same issue, but on windows 7 OS. It was because multiple versions of java was present in the same location C:\Program Files\Java
Java 5, 7, 8, and 9. Although the Environment variables JAVA_HOME and PATH were set to Java 8, Android studio was referring to Java 9.
My Solution, in the menu, click on File > Project Structure
here, point JDK to appropriate location C:\Program Files\Java\jdk
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