Search code examples
javaandroidjarexecutable-jardalvik

Is it possible to convert JVM prepared jar file to Dalvik compatible jar?


I have have a .jar application compatible to JVM. How can I convert it to Dalvik compatible jar file?

I have come to know that using Java decompiler, I can convert all byte codes inside jar to source code. Is it the only option that I compile the source code with dx tool to make it Dalvik compatible?


Solution

  • You can use the dx tool as described in How to convert .jar or .class to .dex file?. Even if you are able to accomplish this, you will still not be able to simply run the dexed JAR file on an Android device as Android uses a different model than desktop Java does.