Give me all your tricks for minimizing jar file size

Posted on 16th Feb 2014 by admin


Hi, I'm coming close to releasing my J2ME game... I am kicking up against the 64k size barrier which I have imposed as a maximum size for my game. I would like to add more levels to the game but the only way I can do that Is to make the jar smaller... Oh yeah I have made the decision to NOT have it download any data (maps, etc...) over the internet as well.

I have heard about using preprocessors to get rid of statics and that would make it smaller... Any thoughts, suggestions? Sun one studio 5 ME doesn't seem to support preprocessing... is there any free or cheap IDE that does?

Do any obfuscators do a significantly better job at reducing size than the retroguard one does?

I've tried to eliminate any common code amongst classes and put it in static functions that get called from many places...

I'm wondering about using shorts internally instead of ints... at first I was going with shorts thinking it would be a size savings, but now I'm thinking that all the conversions to ints and back are probably a size loss... anyone know the empirical answer?

If you have any tips to reduce jar size, please respond :)

Other forums