mark
mark

Reputation: 62876

Is there such a thing as static jar linking in java?

Is there static jar linking in java?

The way I see it is that static linking against a jar extracts the relevant class files from the jar and inserts them into the final product jar. Of course, it should copy any relevant license files from the library jar into the product jar.

Motivation.

I would like to use the ExpandProperties class from ant.jar. The feature itself is likely to occupy just a fraction of the 1.8M, which is the size of ant.jar.

Upvotes: 2

Views: 2157

Answers (2)

lxbndr
lxbndr

Reputation: 2208

Obfuscators are also capable to merge several jars into one. Note that this action will break sealed and signed libraries.

Upvotes: 0

Jonathan S. Fisher
Jonathan S. Fisher

Reputation: 8876

Maven can do that with the assembly plugin, but you usually run into licensing issues if there are open source libraries involved.

Upvotes: 6

Related Questions