I just installed the Android SDK R16 and JDK 7, but I keep getting the error
Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties."
I am using some features of the JRE 1.7, so I can't just switch it to 1.6. How can I fix this problem?
A copy of the latest OpenJDK comes bundled with Android Studio 2.2 and higher, and this is the JDK version we recommend you use for your Android projects.
TLDR; SDK is a blanket term for any package of development tools for a language. ADK is a Java development kit but it's customized for Android-specific development. JDK is the Java Development Kit for developing Java applications.
As per the docs, JDK 17 isn't supported yet in Android Studio. Actually, JDK 11 was supported starting from version 4.2 which was released in April 2021.
Since Android apps are written in Java, you will need the Oracle Java compiler and libraries on your system. These are collectively called the Java Development Kit or "JDK" for short. (If you are certain that you already have JDK 1.8 or higher on your computer, such as from taking CS 106A, you can skip to Step 2.)
Yes, you can use Java 1.7 for the Android development. You must keep source compatibility with Java 6 during compile and only the next problem is because of the changed default algorithm for jarsigner.
This is solved in Stack Overflow question Android signing with Ant (workaround).
But it is already fixed in Ant. So the official support will be directly in the Android SDK soon.
If you want to use Maven for the build, the solution is in What kind of pitfals exist for the Android APK signing.
Update: Latest version of Ant, Maven Plugin or Gradle has no problem with Java 7 or Java 8, so this is already obsolete.
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