0

I was looking (hoping) for a simple mapping from each android OS version to a version of Java.

More specifically. I am focusing on the Android OS side (not the application side), the ART: what version of the JVM does it uses.

I still have some hope due to source code diving seems to relate it to the java supported by dx (I guess now d8 and r8), the dex compiler.

In libcore/libart/src/main/java/java/lang/AndroidHardcodedSystemProperties.java:

final static String[][] STATIC_PROPERTIES = {
// None of these four are meaningful on Android, but these keys are guaranteed
// to be present for System.getProperty. For java.class.version, we use the maximum
// class file version that dx currently supports.
{ "java.class.version", "50.0" },
{ "java.version", JAVA_VERSION },

But the android developer blog may rather imply the library of java used is ad hoc/custom (blogpost) with a mix of versions: First openjdk 1.7 with desugared features of openjdk 1.8 Now more like 8 (but not all features) with desugared features of Java 8+.

triom
  • 1
  • 2
  • "the ART: what version of the JVM does it uses" -- it does not use any version of the JVM. ART is its own runtime. "a simple mapping from each android OS version to a version of Java" -- what do you mean by "a version of Java"? – CommonsWare Mar 09 '23 at 12:06
  • Fair point. Better question could be, at its core(hence I mentioned ART), what version of Java is each version of Android shipped with ? – triom Mar 09 '23 at 12:12
  • Again: what do you mean by "version of Java"? Please be very specific about what you mean here. A VM is not the same as a bytecode format, neither of which are the same as a class library, etc. – CommonsWare Mar 09 '23 at 13:15
  • Ok. I try to know what version of the java runtime classes (e.g. java.lang.String) is used and compiled. From which jdk are they taken from (6,7,8,9,11, a mix) depending on the OS version. (thx for helping me being more precise btw) – triom Mar 09 '23 at 13:57
  • Check out my answer [here](https://stackoverflow.com/a/76621845/6396174)! – bmdelacruz Jul 05 '23 at 15:36

0 Answers0