• <i id='Av4w2'><tr id='Av4w2'><dt id='Av4w2'><q id='Av4w2'><span id='Av4w2'><b id='Av4w2'><form id='Av4w2'><ins id='Av4w2'></ins><ul id='Av4w2'></ul><sub id='Av4w2'></sub></form><legend id='Av4w2'></legend><bdo id='Av4w2'><pre id='Av4w2'><center id='Av4w2'></center></pre></bdo></b><th id='Av4w2'></th></span></q></dt></tr></i><div id='Av4w2'><tfoot id='Av4w2'></tfoot><dl id='Av4w2'><fieldset id='Av4w2'></fieldset></dl></div>

    <small id='Av4w2'></small><noframes id='Av4w2'>

      1. <legend id='Av4w2'><style id='Av4w2'><dir id='Av4w2'><q id='Av4w2'></q></dir></style></legend><tfoot id='Av4w2'></tfoot>

          <bdo id='Av4w2'></bdo><ul id='Av4w2'></ul>

      2. 在 Dalvik VM(Android 的 VM)上,您不能在 Sun VM 中做什么?

        时间:2023-08-24
      3. <small id='jKMAm'></small><noframes id='jKMAm'>

        <i id='jKMAm'><tr id='jKMAm'><dt id='jKMAm'><q id='jKMAm'><span id='jKMAm'><b id='jKMAm'><form id='jKMAm'><ins id='jKMAm'></ins><ul id='jKMAm'></ul><sub id='jKMAm'></sub></form><legend id='jKMAm'></legend><bdo id='jKMAm'><pre id='jKMAm'><center id='jKMAm'></center></pre></bdo></b><th id='jKMAm'></th></span></q></dt></tr></i><div id='jKMAm'><tfoot id='jKMAm'></tfoot><dl id='jKMAm'><fieldset id='jKMAm'></fieldset></dl></div>
        • <tfoot id='jKMAm'></tfoot>

            • <bdo id='jKMAm'></bdo><ul id='jKMAm'></ul>
              <legend id='jKMAm'><style id='jKMAm'><dir id='jKMAm'><q id='jKMAm'></q></dir></style></legend>

                <tbody id='jKMAm'></tbody>
                • 本文介绍了在 Dalvik VM(Android 的 VM)上,您不能在 Sun VM 中做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我知道你可以在 Dalvik 的 VM 中运行几乎所有的 Java,而你可以在 Java 的 VM 中运行,但是限制不是很清楚.有没有人遇到任何主要的绊脚石?有什么大图书馆有问题吗?任何编译成 Java 字节码的语言(ScalaJython 等)都不能按预期工作?

                  I know that you can run almost all Java in Dalvik's VM that you can in Java's VM but the limitations are not very clear. Has anyone run into any major stumbling blocks? Any major libraries having trouble? Any languages that compile to Java byte code (Scala, Jython etc...) not work as expected?

                  推荐答案

                  Dalvik 不会处理或不会以与标准 Java 字节码完全相同的方式处理许多事情,尽管其中大多数都非常先进.

                  There is a number of things that Dalvik will not handle or will not handle quite the same way as standard Java bytecode, though most of them are quite advanced.

                  最严重的例子是运行时字节码生成和自定义类加载.假设您想创建一些字节码,然后使用类加载器为您加载它,如果该技巧在您的普通机器上有效,则保证在 Dalvik 上无效,除非您更改字节码生成.

                  The most severe example is runtime bytecode generation and custom class loading. Let's say you would like to create some bytecode and then use classloader to load it for you, if that trick works on your normal machine, it is guaranteed to not work on Dalvik, unless you change your bytecode generation.

                  这会阻止您使用某些依赖注入框架,最著名的例子是 Google Guice(尽管我相信有些人在做这方面的工作).另一方面,AspectJ 应该可以工作,因为它使用字节码检测作为编译步骤(尽管我不知道是否有人尝试过).

                  That prevents you from using certain dependency injection frameworks, most known example being Google Guice (though I am sure some people work on that). On the other hand AspectJ should work as it uses bytecode instrumentation as a compilation step (though I don't know if anyone tried).

                  至于其他 jvm 语言——最终编译为标准字节码并且在运行时不使用字节码检测的任何东西都可以转换为 Dalvik 并且应该可以工作.我知道人们确实在 Android 上运行过 Jython,而且运行良好.

                  As to other jvm languages -- anything that in the end compiles to standard bytecode and does not use bytecode instrumentation at runtime can be converted to Dalvik and should work. I know people did run Jython on Android and it worked ok.

                  需要注意的另一件事是没有及时编译.这不是严格意义上的 Dalvik 问题(如果你愿意,你可以随时编译任何字节码)但是 Android 不支持并且不太可能这样做.实际上,虽然标准 Java 的微基准测试毫无用处——组件在测试中的运行时特性与作为大型系统的一部分不同——但 Android 手机的微基准测试完全有意义.

                  Other thing to be aware of is that there is no just in time compilation. This is not strictly Dalviks problem (you can always compile any bytecode on the fly if you wish) but that Android does not support that and is unlikely to do so. In the effect while microbenchmarking for standard Java was useless -- components had different runtime characterstics in tests than as parts of larger systems -- microbenchmarks for Android phones totally make sense.

                  这篇关于在 Dalvik VM(Android 的 VM)上,您不能在 Sun VM 中做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:CATALINA_OPTS 与 JAVA_OPTS - 有什么区别? 下一篇:如何隐藏警告“非法反射访问"在没有 JVM 参数的 java 9 中?

                  相关文章

                  1. <tfoot id='TqoJq'></tfoot>
                      <bdo id='TqoJq'></bdo><ul id='TqoJq'></ul>
                      <i id='TqoJq'><tr id='TqoJq'><dt id='TqoJq'><q id='TqoJq'><span id='TqoJq'><b id='TqoJq'><form id='TqoJq'><ins id='TqoJq'></ins><ul id='TqoJq'></ul><sub id='TqoJq'></sub></form><legend id='TqoJq'></legend><bdo id='TqoJq'><pre id='TqoJq'><center id='TqoJq'></center></pre></bdo></b><th id='TqoJq'></th></span></q></dt></tr></i><div id='TqoJq'><tfoot id='TqoJq'></tfoot><dl id='TqoJq'><fieldset id='TqoJq'></fieldset></dl></div>

                      <legend id='TqoJq'><style id='TqoJq'><dir id='TqoJq'><q id='TqoJq'></q></dir></style></legend>

                      <small id='TqoJq'></small><noframes id='TqoJq'>