How can I compile a java file on my Android Emulator?

删除回忆录丶 提交于 2019-12-11 02:58:25

问题


I have a java file on my android emulator and I need to compile it on the emulator terminal. Whenever I write "javac filename.java" I get an error message saying: "Permission denied".


回答1:


You can not do this. When you compile a java source file it is first complied into a .class file which is Java byte code. After that the class files are then compiled again into a .dex file which is the Dalvik byte code which the Dalvik virtual machine can run. This .dex file is then compressed into an .apk file which is the archive which contain all your application's data. You can read more about it here.




回答2:


I'd start by looking at Terminal IDE, although on the emulator, I can't imagine it will be much fun.

In theory, it should work, if slowly. It's java/javac/apkbuilder/etc. with vim, and doesn't require rooting.



来源:https://stackoverflow.com/questions/8863424/how-can-i-compile-a-java-file-on-my-android-emulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!