Selective packaging for cans

I have my little program.jar that uses a small part of the huge library.jar.

Is there a tool for repacking several cans into one so that it can work autonomously and as little as possible?

Update: .

+3
source share
3 answers

There is proguard , with ant and maven plugins. It deletes an unused code, optionally confuses and compresses to one jar.

Proguard reduces size on two fronts

  • only those classes that are actually used are stored in the last bank.
  • , . , , , .

, java, . , , , . Class.forName( "xyzFoo" ), - , . , classloader , , .

pack200, .

+3

You can try to use the Ant task jar- here you can read more information.

+2
source

Source: https://habr.com/ru/post/1746672/


All Articles