(keitai-l) Re: Maybe OT: Java Link & Load Q

From: Gary James <gary.james_at_lincmedia.co.jp>
Date: 09/17/01
Message-ID: <3BA55BD6.2D32AEAA@lincmedia.co.jp>
> I have a question on how java classes and packages are packaged into an
> i-appli:
> Say class A uses class B.
> Class B uses package C, which may be a 3rd party package.
> Class A also uses package C.
>
> To be a little more concrete - say my i-appli (A) uses a data class (B).  B
> makes use of an XML package like DOM (C).  Data returned by B is in XML format,
> so the Applet/appli needs C in order to make sense of it.
>

You'll have fun trying to fit DOM into 10K :-)

> 1.  How do I get my i-appli to use C?  I understand that on my PC I put the
> package C in my classpath and it gets loaded - but on i-mode, the package has
> to be loaded in with the i-appli jar, right?  Do I need to put all the
> necessary classes & packages in the same jar?  Or does the compiler or another
> tool do that?
>

Everything will need to be put into the same Jar.  If you have any extra
libraries that your application needs you'll need to put them into the
Jar manually.

> 2.  Is the preverifier involved in this?  Just what does the preverifier do,
> anyway?
>

All classes need to be preverified before they get put into the Jar
(including any from an extra library).  Perverifying basically modifies
the classes so that they will work with the KVM.

> 3.  If my classes (A & B) make use of only one class from package C, is all of
> package C be included anyway?  What if my classes use only one method of one
> class?  Would something like Java Blender trim unused stuff (classes & methods)
> from my i-appli jar?
>

When I tried using Java Blender it crashed on me.  I'd very very
interested if there is software that could remove unused
methods/classes.  Anyone else know any good software for this?

> 4.  Would it be any different in terms of jar size if all the classes were in
> the same package?
>

Certainly, but I'm not sure by how much.  At very least you save bytes
from not needing so much declaration.


--
Gary James
Project Leader (Theta Team)
Layer-8 Technologies, LINC Media Group




[ Need archives? How to unsubscribe? http://www.appelsiini.net/keitai-l/ ]
Received on Mon Sep 17 04:59:42 2001