Does Android work with JRE 7?

Does Android work with JRE 7? I can not find any documentation on it.

+6
source share
3 answers

Android does not use JRE ... it uses its own runtime environment optimized for mobile applications, Dalvik VM. however, it has most of the JRE features.

+7
source

Android uses the Dalvik virtual machine.

+1
source

Android runtime is Dalvik, but I think the question is whether it is possible to use java libraries (.jar) compiled with Java 7 (for example, if you use a new attempt with the suggestion of resources in your source code, will it work on an Android app?).

In this case, I saw what you can use with Gradles: http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Using-sourceCompatibility-1.7

... which says:

With Android KitKat (buildToolsVersion 19) you can use the diamond operator, multi-user mode, lines in switches, try with resources, etc. To do this, add the following to the assembly file: *

android { compileSdkVersion 19 buildToolsVersion "19.0.0" defaultConfig { minSdkVersion 7 targetSdkVersion 19 } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } } 

Checking the Android API. I see that this does not fully meet the requirements, ForkJoinPool does not exist in the Android API, but Autoclosable does it (which is used when trying with resources), but from api 19.

+1
source

Source: https://habr.com/ru/post/900567/


All Articles