我如何可以编译我的Andr​​oid模拟器的Java文件? [英] How can I compile a java file on my Android Emulator?

查看:129
本文介绍了我如何可以编译我的Andr​​oid模拟器的Java文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的Andr​​oid模拟器的Java文件,我需要编译模拟器终端上。每当我写的javac filename.java我得到一个错误信息说:权限被拒绝

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

推荐答案

您不能做到这一点。当你编译Java源文件时,它首先被编译成一个.class文件是Java字节code。在这以后,类文件然后重新编译成.dex文件,该文件是在Dalvik字节code其中Dalvik虚拟机可以运行。这.dex文件是那么COM pressed成.apk文件是包含所有应用程序的数据归档。你可以阅读更多关于它这里

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.

这篇关于我如何可以编译我的Andr​​oid模拟器的Java文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆