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?
Thanks, Tom
Currently, dx.jar
has been moved to
adt-bundle-*\sdk\build-tools\17.0.0\lib
You can find the source code of dx here.
Additional to CommonsWare's comment.
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.
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).
Last, as a quick reference, this is command how SDK typically use dx.jar to dex you java bytecode with external jar libraries:
[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, ... ...]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With