views:

157

answers:

2

Is there a procedure by which you can optimize/shrink/select/obfuscate only 'used by your app' classes/methods/fields from rt.jar provided by Sun by using some optimization software like ProGuard (or maybe other?). Then you would actually be able to minimize the download size of your application considerably and make it much more secure ? Right?

Related questions:

  • Do you know if Sun's "jigsaw project" which is waited to come out, is intended to automatically handle this particular issue?
  • Did somebody manage yet to form an opinion about Avian java alternative? Please share it here.

Thank you.

A: 

From the ProGuard Website:

the run-time classes from Sun's Java 6

Original size: 53 M

After shrinking: 23 M

After optim.: 22 M

After obfusc.: 18 M

Total reduction: 66 %

I've just recently seen apps Pack200, which seems to be something you might be interested in.

Project Jigsaw will modularize Java/the JRE (7), so that only modules needed are loaded.

Tedil
I couldn find where on ProGuard's website you can find the mentioned above statement?
PatlaDJ
aah, sorry, I've found it. It's here: http://proguard.sourceforge.net/results.html But how on earth can I process rt.jar, they mention a configuration file of 1500+ line, where can I find it?
PatlaDJ
A: 

The Sun/Oracle JRE Binary License does not permit subsetting the Java Runtime, or fiddling with rt.jar. There are a few optional files that you may remove when bundling the JRE with your app, but that won't make much difference.

So wait for JDK 7 or explore a Sun-approved way to reduce the download size of your Java app.

Dmitry Leskov