Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

class

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.

like image 759
arreche Avatar asked Sep 06 '25 03:09

arreche


1 Answers

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.

like image 194
willcodejavaforfood Avatar answered Sep 07 '25 21:09

willcodejavaforfood