This is where JAR file optimization is crucial for deploying your J2ME mobile application out in the wild. Here's a few thing that you can do to reduce your JAR file size :

Optimise PNG files

PNG is a graphic format used primarily by J2ME devices, and is guaranteed to be cross-platform between mobile devices that implements J2ME. The best part with PNG file is that its bitmap data is compressed using the deflate compression algorithm which can be easily optimised by easily obtainable tool :

* PNGCrush(

* OptiPNG(

* PNGOut(


Obfuscation does help in chopping unecessary code, renaming long variables and classes, thus making the class files smaller. Don't forget to Obfuscate your package files before deployment. It does not only protect your code, but it does save a lot of valueable space. Proguard( and RetroGuard is the most common obfuscator used in J2ME application

Recompress JAR files

Finally, after going through optimizing PNG files and obfuscating, you might want to try to recompress your JAR files using a tuned JAR compressor which favors size over speed. For this purpose, I prefer using KJar(, a JAR file recompressor based on Ken Silverman's KZIP. This final step combined with previous optimisation will greatly reduces your JAR file