Java Decompiler HOW-TO

This document will help you to de-compile the Java class programs. This documents gives a list of decompilers which can reverse
engineer the Java class files and generate the Java source code files.
Thie is very helpful if you do not have the Java source code file and have only
the Java class files. The information in this document applies to all
the operating sytems where Java language/Java VM runs.

Java de-compiler is very useful especially if you have *.class
files and you do not have access to the source code. Some vendors
do not ship the source code for java class files, in which case
you use the java decompiler to look at the source code.

See also the "javap" command from Sun Microsystems. This command is
available as soon as you install the JDK from Sun Microsystems.
At unix prompt type -

For 100% assurance you need a SCIENTIFIC way to
validate and trust the Java Decompiler program. The method described
in this section will enable the decompiler program to be accepted
as "trust-worthy" and reliable.

In order to verify that the decompiler program
is regenerating the Java source-code properly,
use the following technique -

Generate the class file from the generated
source code using the compiler -

PDF file can be generated from postscript file using
either acrobat distill or Ghostscript.
And postscript file is generated
from DVI which in turn is generated from LaTex file.
You can download distill software from
http://www.adobe.com. Given below
is a sample session:

Or you can use Ghostscript command ps2pdf.
ps2pdf is a work-alike for nearly all the functionality of
Adobe's Acrobat Distiller product: it
converts PostScript files to Portable Document Format (PDF) files.
ps2pdf is implemented as a very small command script
(batch file) that invokes Ghostscript, selecting a special "output device"
called pdfwrite. In order to use ps2pdf, the pdfwrite
device must be included in the makefile when Ghostscript was compiled;
see the documentation on building Ghostscript for details.

This document is written in linuxdoc SGML format. The Docbook SGML format
supercedes the linuxdoc format and has lot more features than linuxdoc.
The linuxdoc is very simple and is easy to use. To convert linuxdoc SGML
file to Docbook SGML use the program ld2db.sh and some perl scripts.
The ld2db output is not 100% clean and you need to use the clean_ld2db.pl
perl script. You may need to manually correct few lines in the document.

In order to view the document in dvi format, use the xdvi program. The xdvi
program is located in tetex-xdvi*.rpm package in Redhat Linux which can be
located through ControlPanel | Applications | Publishing | TeX menu buttons.
To read dvi document give the command -

You can read postscript file using the program 'gv' (ghostview) or
'ghostscript'.
The ghostscript program is in ghostscript*.rpm package and gv
program is in gv*.rpm package in Redhat Linux
which can be located through ControlPanel | Applications | Graphics menu
buttons. The gv program is much more user friendly than ghostscript.
Also ghostscript and gv are available on other platforms like OS/2,
Windows 95 and NT, you view this document even on those platforms.

Copyright policy is GNU/GPL as per LDP (Linux Documentation project).
LDP is a GNU/GPL project.
Additional requests are - you retain the author's name, email address
and this copyright notice on all the copies. If you make any changes
or additions to this document then you should
intimate all the authors of this document.