Automatic creation of Java archives
PrefaceCommand line versionEclipse plugin
Bernd Eggink, monoped@users.sourceforge.net Project page: SourceForge.net
Reflection
If option -d is supplied, Autojar scans the bytecode of every class for invocations of Class.forName() and warns about any occurence. In cases where the method's parameter is a string literal, Autojar knows the class in advance; the message will then look like this:
* Dynamic loading: class Test, method g, name="Blah"
If option -a is present (implies -d), Autojar tries to find and include this class in the usual way. If it succeeds, the message reads
* Dynamic loading: class Test, method g, name="Blah" (RESOLVED)
If, however, Class.forName() is called with a string reference, Autojar can't find out the class name. Such calls are printed at the end of the run in a separate list. Example:
* Dynamic loading, unknown classname:
    class Test, method f
    class Foo, method bar
The resulting archive may then be incomplete, and using it may lead to ClassNotFound exceptions, provided that the corresponding Class.forName() calls actually get executed.

Compiler generated Class.forName() calls are ignored.

up
Created 2011-05-10 by mopcoge