Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do the apps written in java run only on android, even if java is platform independent

Tags:

java

android

Years ago I studied core java in that I read that one of the features of java is that it is platform independent. Reference: https://www.javatpoint.com/features-of-java

Now I am working on android development, android apps are developed using core java. Then why is it that those apps are not supported in Windowsphone or ios?

like image 484
Bullet Avatar asked Oct 29 '25 08:10

Bullet


1 Answers

In Java the code is first compiled into byte code. This byte code is platform independent.This code is executed in JVM. JVM is part of JRE. JRE is different for every platform. You need to download and install JRE according to your platform, Windows or Linux.

Android does not use JVM. The compiled byte code is converted Dex byte code which runs on DVM. DVM only exists for Android as of now. So code written for Android cannot run on other platforms.

like image 159
aman_41907 Avatar answered Oct 31 '25 01:10

aman_41907



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!