How the Java file is converted into a class file; class how to convert to a jar file; How to convert a jar file into binary dex

Source: Internet
Author: User

Command
1.java file converted to class file: Javac-source 1.6-target 1.6 X.java (X.java is the file to be converted, the default is to generate a class file of the same name)
Such as:

D:\java\studio\sdk\build-tools\22.0.1>javac-source 1.6-target 1.6 com/chaos/ha
Ck/AntiLazyLoad.java

2.class file converted to jar file: Jar CVF X.jar Y.class (Y.class is the file to be converted, X.jar is the converted file)
Such as:

D:\java\studio\sdk\build-tools\22.0.1>jar cvf hack.jar Com/chaos/hack/antilazylo
ad.class
added list
adding: com/chaos/hack/antilazyload.class (input = 213) (output = 178) (compressed 16%)

3. Convert the jar file into a dex binary jar file: Dx–dex–output=x.jar Y.jar (Y.jar is the file to be converted, X.jar is the converted file)
Such as:

D:\JAVA\STUDIO\SDK\BUILD-TOOLS\22.0.1>DX--dex--output=patch_dex.jar Patch.jar
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.