什么是dx.jar在Android的SDK? [英] What is dx.jar in the Android SDKs?

查看:1369
本文介绍了什么是dx.jar在Android的SDK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是dx.jar文件,我在一些我已经安装了Android SDK管理器的Andr​​oid SDK版本的看的目的;该文件将显示在工具/ lib目录/ dx.jar我没有看到Android的8.0及以上以上版本的文件。然而IntelliJ IDEA的给出了一个错误,当我尝试建立与Android-8及以上的项目,说dx.jar不存在。是什么给了?

What is the purpose of the dx.jar file that I see in some of Android SDK versions that I've installed with the Android SDK manager; the file appears under tools/lib/dx.jar I do NOT see the file in versions above android-8 and above. However Intellij IDEA gives an error when I try to build a project with android-8 and above, saying that dx.jar doesn't exist. What gives?

谢谢,
汤姆

推荐答案

附加CommonsWare的评论。

Additional to CommonsWare's comment.

该dx.jar是原来位于 Android的SDK /平台/ Android的X / tools / lib目录/ 之前(尤其是在Android的3和Android-4) ,并转移到 Android的SDK /平台-tools / lib目录/ 之后。不幸的是这从未在任何官方消息记录,可能是因为它是谷歌它不希望消费者开发被人打扰的内部工具的一部分。退房这个博客以看到这个问题。

The dx.jar was original located under android-sdk/platforms/android-X/tools/lib/ before (especially in android-3 and android-4), and moved to android-sdk/platform-tools/lib/ later. Unfortunately this has never documented in any official source, probably because it is part of internal tools which Google doesn't want to consumer developer to be bothered. check out this blog to see the problem.

/工具/和Android的SDK /平台的工具/到PATH环境变量中,你应该罚款访问dx.jar,除非你使用一个真的老的Andr​​oid SDK版本(我怀疑)。

As long as you follow Android installation guide and add android-sdk/tools/ and android-sdk/platform-tools/ to your PATH environment variable, you should be fine to access dx.jar, unless you use a really old Android SDK version (I doubt that).

最后,作为一个快速参考,这是命令SDK通常如何使用dx.jar来DEX你的外部jar库Java字节code:

Last, as a quick reference, this is command how SDK typically use dx.jar to dex you java bytecode with external jar libraries:

[信息] C:\\ Program Files文件\\的Java \\ jdk1.6.0_21 \\ jre的\\ BIN \\ java中[-Xmx1024M,罐子,C:\\ Program Files文件\\的Andr​​oid \\ Android的SDK \\平台工具\\ lib目录\\ DX的.jar,--dex,--output = C:\\工作区\\ MyProject的\\目标\\ classes.dex,C:\\工作区\\ MyProject的\\目标\\类,C:\\工作区\\ myprojec \\库\\共lib.jar, ......]

[INFO] C:\Program Files\Java\jdk1.6.0_21\jre\bin\java [-Xmx1024M, -jar, C:\Program Files\Android\android-sdk\platform-tools\lib\dx.jar, --dex, --output=C:\workspace\myproject\target\classes.dex, C:\workspace\myproject\target\classes, C:\workspace\myprojec\libs\common-lib.jar, ... ...]

这篇关于什么是dx.jar在Android的SDK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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