(keitai-l) Re: 'Official' SDK by DoCoMo

From: Henry Minsky <hqm_at_ai.mit.edu>
Date: 03/28/01
Message-Id: <5.0.2.1.2.20010328115744.020b1ea0@pop.ai.mit.edu>
>
> > What are people using to compress their Java classes?
> >
> > I am using JOpt, which is
> > pretty good.
> >
>
>I tried out Jopt.  It looks good.  I gave it a Jar file made by the SDK
>and it reduced the size by 10-20%.  However, I tried to run the
>application on the phone and it didn't work anymore.  Jopt did output a
>few warnings.  I'm guessing that Jopt isn't compatible with Jar files
>produced by the SDK.  Did you manage to use Jopt in conjunction with the
>SDK?
>
>Gary.


You can't run JOpt after you have run the preverifier - you need to run it
on the class files before you preverify them and put them in the jar file.

Here is an example of size reduction from running JOpt:

Class file size when compiled with  "javac -O -g:none":

HtmlCanvas.class = 11421 bytes

If I run JOPT and then the preverifier, and make a jar
file containing this single class, I get a jar filesize

JOPT.jar = 7083 bytes

If I skip JOPT, and make a jar file, I get this size:

NO_JOPT.jar = 9006 bytes


So JOPT seems to be saving me about 20%

The applications seem to run fine on my phone (F503i).

See http://www.ai.mit.edu/people/hqm/imode/imode.html




[ Did you check the archives?   http://www.appelsiini.net/keitai-l/ ]
Received on Wed Mar 28 06:05:06 2001