home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Java / Java.zip / jados155.zip / README.TXT < prev   
Text File  |  1998-05-29  |  5KB  |  134 lines

  1. This is README file for Jad - the fast Java Decompiler.
  2. Jad home page: http://web.unicom.com.cy/~kpd/jad.html
  3. Copyright 1997-98 Pavel Kouznetsov.
  4.  
  5. 0. Please read a disclaimer on Jad home page.
  6.  
  7. 1. Installation.
  8.  
  9. Unzip jad.zip file into any appropriate directory on your hard drive.
  10. This will create two files:
  11.  
  12.     - an executable file named 'jad.exe' (Windows 95/NT)
  13.       or 'jad' (Linux)
  14.  
  15.     - this README file
  16.  
  17.  
  18. No other setup is required.
  19.  
  20. 2. How to use Jad
  21.  
  22. To decompile a single JAVA class file 'example1.class' 
  23. type the following:
  24.  
  25.      jad example1.class
  26.  
  27. This command will create file 'example1.jad' in the current directory.
  28. If such file already exists Jad asks if you want to overwrite it.
  29. Option -o allows overwriting without confirmations.
  30.  
  31. You can omit .class extension and/or use wildcards in the names of
  32. input files.
  33.  
  34. Option -s <ext> allows to change output file extension:
  35.  
  36.      jad -sjava example1.class
  37.  
  38. This command will create file 'example1.java'. Be careful when using
  39. options -o and -sjava together, because Jad can accidentally overwrite
  40. your own source files.
  41.  
  42. Jad uses JAVA class name as an output file name. For example, if class
  43. file 'example1.class' contains JAVA class 'test1' then Jad will create
  44. file 'test1.jad' rather then 'example1.jad'. If you want to specify
  45. your own output file name use output redirection:
  46.  
  47.    jad -p example1.class > myexm1.java
  48.  
  49. Option -d allows you to specify another directory for output files,
  50. which are created, by default, in the current directory. For example:
  51.  
  52.    jad -o -dtest -sjava *.class
  53.  
  54.    (or jad -o -d test -s java *.class, which has the same effect)
  55.  
  56. This command will decompile all .class files in the current directory 
  57. and place all output files with extension .java into directory 'test'.
  58.  
  59.  
  60. If you want to decompile the whole tree of JAVA classes, then
  61. use the following command:
  62.  
  63.    jad -o -r -sjava -dsrc tree/**/*.class
  64.  
  65. This command will decompile all .class files located in all 
  66. subdirectories of 'tree' and create output files in subdirectories
  67. of 'src' according to package names of classes. For example, if file 
  68. 'tree/a/b/c.class' contains class 'c' from package 'a.b' then 
  69. output file will have a name 'src/a/b/c.java'.
  70.  
  71. Note the use of 'two asterisks' wildcard ('**') in the previous
  72. command. It is handled by Jad rather then command shell, so on
  73. UNIX the last argument should be single-quoted:
  74.  
  75.    jad -o -r -sjava -dsrc 'tree/**/*.class'
  76.  
  77.  
  78. In case you want to check the accuracy of the decompilation or just
  79. curious, there is an option -a which tells Jad to annotate the output
  80. with JAVA Virtual Machine bytecodes.
  81.  
  82. Jad looks for the inner classes in the directory of their top-level
  83. container class.
  84.  
  85. 3. List of command-line options.
  86.  
  87. Jad accepts the following options:
  88.  
  89.    -a       - annotate the output with JVM bytecodes
  90.    -af      - same as -a, but outputs fully qualified names when annotating;
  91.    -b       - output redundant braces (e.g., if(a) { b(); }, default: no)
  92.    -disass  - disassemble method bytecodes (no JAVA source generated)
  93.    -d <dir> - directory for output files (will be created when necessary)
  94.    -f       - output fully qualified names for classes/fields/methods
  95.    -i       - output default initializers for all non-final fields
  96.    -l<num>  - split strings into pieces of maximum <num> chars (default: no)
  97.    -nl      - split strings on newline character (default: no)
  98.    -o       - overwrite output files without confirmation
  99.    -p       - send decompiled code to STDOUT (e.g., for piping)
  100.    -r       - restore package directory structrure
  101.    -s <ext> - output file extension (by default '.jad')
  102.    -t       - use tabs instead of spaces for indentation
  103.    -t<num>  - use <num> spaces for indentation (default: 4)
  104.    -v       - display method names being decompiled
  105.    -8       - convert UNICODE strings into 8-bit strings
  106.               using current ANSI code page (Win32 only)
  107.  
  108. Other available options:
  109.  
  110.    -dead    - try to decompile dead parts of code (if any) (default: no)
  111.    -inner   - turn off the support of inner classes (default: turned on)
  112.    -ff      - output class fields before methods (default: after)
  113.    -lvt     - ignore Local Variable Table information
  114.    -nocast  - don't generate auxiliary casts
  115.    -nocode  - don't generate the source code for methods
  116.    -noctor  - suppress the empty constructors
  117.    -nodos   - do not check for DOS mode of class file (default: check)
  118.    -pi<num> - pack imports into one line after <num> imports (default: 3)
  119.    -pv      - pack fields with identical types into one line (default: no)
  120.    -pa <pfx>- prefix for all packages in generated source files
  121.    -pc <pfx>- prefix for classes with numerical names (default: _cls)
  122.    -pf <pfx>- prefix for fields with numerical names (default: _fld)
  123.    -pe <pfx>- prefix for unused exception names (default: ex)
  124.    -pl <pfx>- prefix for locals with numerical names (default: _lcl)
  125.    -pm <pfx>- prefix for methods with numerical names (default: _mth)
  126.    -pp <pfx>- prefix for method parms with numerical names (default: _prm)
  127.    -stat    - display the total number of processed classes/methods/fields
  128.  
  129. All single-word options have three formats:
  130.  
  131.   -o    - 'negates' option value
  132.   -o+   - set option value to 'true' or 'on'
  133.   -o-   - set option value to 'false' or 'off'
  134.