Skip to main content
gamedev.net
🔒 Locked

[java] Jar Compression

Started by gsmaster Apr 26, 2006 at 6:23 AM 8 replies 5.2k views
Original Post
gsmaster
gsmaster
Is there any way to compress a JAR file even further. My game(even small ones) take around 1 mb of space total. Games on cell phones are around .3 kb, and still are generally better games than mine. How do the JAR files become so tiny?
gsmaster
gsmaster
If it helps, this is the sorta stuff the few cell games I've imported into eclipse are-

ˆ#"÷O^ˆ¶ÊGO“î ª�þXC+À‰PçAE*¾VÿÌ@u�tÏþ"á‡DODˆ 3&ñA‚‰À
"Š@Du™t�þé

LorenzoGatti
LorenzoGatti
Quote:
Original post by gsmaster
Games on cell phones are around .3 kb, and still are generally better games than mine.

0.3 kB seems a reasonable size for a JAD file, not a JAR file. JAD files are small because they reference the actual JAR files; any J2ME development environment will let you explore them.
Look for .jad and .jar extensions with the same filename.

Omae Wa Mou Shindeiru
gsmaster
gsmaster
So, to operate a JAD file, do you also need a JAR file?

Also, will Eclipse export as a JAD file?
shmoove
shmoove
In case you don't have it already, the EclipseME is very useful to develop mobile apps with Eclipse. It will create the necessary create jar and jad files.

As for minimizing jar size, this thread is full of tips.

shmoove

[Edited by - shmoove on April 28, 2006 10:15:58 AM]
gsmaster
gsmaster
Thanks!
Jockel
Jockel
You also should have a look at Proguard (http://proguard.sourceforge.net/). (Don't know if it's mentioned at the site that shmoove posted, cause it's not available at the moment).
shmoove
shmoove
I fixed the link (the site just went through some changes that broke it).

It does start out discussing obfuscators, goes on to talking about different jar-ing methods (ie, using different applications to create the jar) and ends up with a lot of talk about compressing the media used (which really is the best way to save space).

As far as obfuscators breaking the stack trace, you don't have to use them until you have a release build and then you presumable won't be needing those stack traces anymore. They are very useful for mobile development.

shmoove

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.