Tutorial :How to know which classes inside a .jar file are referenced?



Question:

I need to deploy only the referenced classes in a very limited environment as A data carousel for Interactive TV. Bandwidth is expensive and .jar files are not supported.


Solution:1

Check out ProGuard which is an obfuscator that will list code and classes that are not used. Obfuscating itself usually results in a smaller foot print.

ProGuard is a free Java class file shrinker, optimizer, obfuscator, and preverifier. It detects and removes unused classes, fields, methods, and attributes. It optimizes bytecode and removes unused instructions. It renames the remaining classes, fields, and methods using short meaningless names. Finally, it preverifies the processed code for Java 6 or for Java Micro Edition.


Solution:2

Sounds like you need a dependency analyzer. This one might do the trick.

ProGuard might be even better, since it can also shrink existing .class files.


Solution:3

Perhaps you could load a custom class loader which does support jar files or ideally pack200 files.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »