简体   繁体   English

是否可以将JVM准备的jar文件转换为Dalvik兼容的jar?

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

I have have a .jar application compatible to JVM. 我有一个与JVM兼容的.jar应用程序。 How can I convert it to Dalvik compatible jar file? 如何将其转换为Dalvik兼容的jar文件?

I have come to know that using Java decompiler, I can convert all byte codes inside jar to source code. 我知道使用Java反编译器,我可以将jar中的所有字节码转换为源代码。 Is it the only option that I compile the source code with dx tool to make it Dalvik compatible? 是我使用dx工具编译源代码以使其与Dalvik兼容的唯一选择吗?

You can use the dx tool as described in How to convert .jar or .class to .dex file? 您可以按照如何将.jar或.class转换为.dex文件中所述使用dx工具 . 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. 即使您能够做到这一点,您仍将无法简单地在Android设备上运行经过处理的JAR文件,因为Android使用的是与台式机Java不同的模型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM