Ozgur
Ozgur

Reputation: 137

Shrinking jar with its dependencies

I have a bunch of jars as a.jar, b.jar, c.jar, d.jar. a.jar is using remaining jars. I am using Test.java in a.java and remaining jars are used by a.java.

I would like to make a tiny jar which is including only necessary classes. Actually I have noticed jarjar tool, but its documentation is not shiny.

By the way, I am not using maven.

Any help?

Thanks

Upvotes: 1

Views: 2379

Answers (1)

Tomasz Nurkiewicz
Tomasz Nurkiewicz

Reputation: 340733

Try ProGuard. From their website:

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.

Upvotes: 2

Related Questions