The only requirement here is to have emma.jar, which you can get from either the complete or the smaller emma-<release>-lib.zip download. (All EMMA tools are implemented as bean-like objects. The command line utilities and ANT tasks are mere frontend drivers for those, so everything you can do on a command line you can do in ANT and vice versa.)
On-the-fly instrumentation
This means taking an existing application and running it using EMMA instrumenting application runner. You can try the SwingSet2 demo shipped with the JDK:
>java -cp emma.jar emmarun -jar .../jdk1.4.2/demo/jfc/SwingSet2/SwingSet2.jar
(As you can see, running the demo through EMMA is basically inserting emmarun between the JVM and the application: it just doesn't get any easier!) Play with the Swing demo a bit and then close it. You will see EMMA writing a plain text coverage report (coverage.txt) to the current directory. The plain text report is meant mostly for quick informal testing. It defaults to showing just the overall and package-level stats and most of it is self-explanatory:
OVERALL COVERAGE SUMMARY: 98% (121/123)! 64% (312/489)! 81% (15500/19172) 77% (2633.6/3441)! all classes OVERALL STATS SUMMARY: total packages: 1 total classes: 123 total methods: 489 total executable files: 31 total executable lines: 3441 COVERAGE BREAKDOWN BY PACKAGE: 98% (121/123)! 64% (312/489)! 81% (15500/19172) 77% (2633.6/3441)! default package
For every type of coverage the overall coverage percentage is shown, as well the actual percentage ratio: the latter is important for knowing which areas need more testing work (a half-covered package with 500 classes needs more attention than a half-covered package with 10 classes).
The odd-looking exclamation marks in some columns denote items that fail default coverage criteria (e.g., 80% for line coverage and 70% for method coverage).