How can I compile a java file on my Android Emulat

2019-07-12 04:37发布

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".

2条回答
疯言疯语
2楼-- · 2019-07-12 05:23

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.

查看更多
萌系小妹纸
3楼-- · 2019-07-12 05:27

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.

查看更多
登录 后发表回答