Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Java bytecode on the Android - Sun JVM on top of DalvikVM

Since both the java implementation (OpenJDK) and Android's virtual machine DalvikVM are opensource it must be possible to implement Sun's JavaVM on top Google's DalvikVM. This would make it possible to run JVM based apps and languages (Clojure, Jython) out-of-the-box on the android.

Is there an ongoing effort to produce such an implementation of the Sun JVM?

like image 563
George Avatar asked Mar 22 '09 13:03

George


1 Answers

The OpenJDK makes use of native code so it would be a non-trivial port... there is at least one VM (JikesRVM) that is written in Java, unfortunately it is not a completely working implementation of Java.

Since DalvikVM runs classes that were converted from .class files it should be possible to convert the classes over. Then the "only" issue is when languages generate bytecode on the fly - for that it would require the extra step of converting the generated bytecode over to the DalvikVM format while the program is running on the DalvikVM.

Hmmm.... sort of a JITT (Just In Time Translator) that covertes class files to a DalvikVM files at runtime on the phone. I wonder how slow that would be.

like image 122
TofuBeer Avatar answered Sep 19 '22 13:09

TofuBeer